Search code examples
phpsymfonyurl-routing

Is it possible to make the default parameter values for routes dynamic in symfony2?


I have a route defined in a symfony2 controller using annotations. EG:

@Route("/{year}", name="show_list_for_user", defaults={ "year" = "2012" })

Is it possible to make make the default year dynamic. Maybe to read the year from a service object?


Solution

  • I'm afraid that is not possible, the defaults are static.