skip to Main Content

Php – How to map a date from a query string?

I have a symfony API endpoint that goes like this: /orders/list-all?since=2024-10-21 I'd like to map that query string parameter to a DateTimeImmutable (or DateTimeInterface), like so: public function listOrders( #[OAQueryParameter(name: 'since', in: 'query', description: 'Date de début de la recherche',…

VIEW QUESTION

Php – Symfony 6 Validation Constraints: How to assert that a string has exact length 4

Here is my simplified class of my DTO which is filled by the Serializer: <?php namespace AppApiDto; use OpenApiAttributes as OA; use SymfonyComponentSerializerAnnotationGroups as SerializerGroups; use SymfonyComponentValidatorConstraints as Assert; #[OASchema()] readonly class WorkHour implements DtoInterface { public function __construct( #[OAProperty(description:…

VIEW QUESTION

Php – Symfony 6 website skeleton 404 for controller

I am trying out Symfony the first time. I installed it with composer create-project symfony/website-skeleton crudapp I have an Apache config like this: <VirtualHost *:80> ServerName localhost DocumentRoot "c:/.../Symfony/crudapp/public/" <Directory "c:/.../Symfony/crudapp/public/"> Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require local…

VIEW QUESTION
Back To Top
Search