Category: symfony-routing

Symfony onKernelRequest headers->set dont received on @Route

I have functionm onKernelRequest when i want to add some custom header(in my case api=true||$request->headers->set(‘api’, “true”)) and in all Request $request i can get that header but when i try it on annotation its fail: onKernelRequest: public function onKernelRequest(RequestEvent $event)…

Validate optional input GET parameters passed in through the querystring as integers in Symfony 3.4

In Symfony 3.4, is there a way to validate optional input GET parameters passed in through the querystring as integers? If provided, I am using the $ownerId and $courseId to query the corresponding repositories, however the value needs to be…

How to add prefix to some controllers using annotations?

I have at the moment two controllers. GitlabAuthController UserController I need to add the path prefix api to UserController only. Before I was trying following at annotations.yaml file: controllers: resource: ../../src/Controller/ type: annotation prefix: api But this adds the prefix…