How to make multiple pattern in single Symfony routing?
Normally we have a routing as
blog:
pattern: /
defaults: { _controller: AcmeBlogB
Just to add to john's answer:
I use it a lot with FOSJsRoutingBundle:
/**
* @Route("/", name="route_name_1", options={"expose"=true})
* @Route("/{id}", name="route_name_2", options={"expose"=true})
* @Method("GET")
* @Template()
*/
This way I have one method and two routes.
Just remember to set default $id value:
public function indexAction($id = null)
{
...
}