How to make multiple pattern in single Symfony routing?
Normally we have a routing as
blog:
pattern: /
defaults: { _controller: AcmeBlogBundle:Blog:index, page: 1 }
Is it possible to have two routing patterns?
Something like
blog:
#Below pattern to match with '/' or '/index'
pattern: {/ , /index}
defaults: { _controller: AcmeBlogBundle:Blog:index, page: 1 }
Are you using Symfony2? If you are and can use annotations for your routing instead of yml or xml then it’s possible to have multiple routes defined along these lines:
Then you don’t need to duplicate the action method.