FriendsOfSymfony/FOSRestBundle — Issue #176: Support customization of slug order in routes
Author: jrgns
Created: 2012-01-30 06:07:56+00:00
State: open

When defining a function public function `getCarAction($id)`, it creates the route `/car/{id}.{_format}`.

Why not support the following:

cars:
resource: "@MyBundle/Resources/config/cars.yml"
prefix: /{make}/

This will give you the route

/{make}/car/{id}.{_format}

To support the route, the function needs to be defined as `getCarAction($make, $id)`, which then breaks the route generation, as it generates a route with to `{makes}` in.

Let the generator check if a parameter is already defined in the route before adding it.