FosRestBundle Route generation with CamelCase class

608 Views Asked by At

I have a slight Problem with on of my Controllers.

The Entity the api is for is called: MyEntity so naturally the controller is called: MyEntityController

If I now define an action: public function getMyEntity($id) the route that is generated is called: /mys/:id/entitys

How do I define the controller in a way that the route becomes /my-entities/:id ?

1

There are 1 best solutions below

0
On

Why don't you define the route manually the way you want?: http://symfony.com/doc/current/bundles/FOSRestBundle/7-manual-route-definition.html