Is that possible with symfony2 to define multiple url patterns for a single Controller Action using regular expressions, so we don't have to define several rules ? Thanks in advance
相关问题
- Symfony2 Set Controller in the kernelControllerEve
- Webpack Encore: cannot import local dependencies
- UrlEncodeUnicode and browser navigation errors
- Render custom attribute KNP Menu
- Improve converting string to readable urls
相关文章
- Symfony : Doctrine data fixture : how to handle la
- Symfony is linked to the wrong PHP version
- Symfony2: check whether session exists or not
- C# HttpClient.SendAsync always returns 404 but URL
- Is there a way to modify the entity mapping config
- symfony2 form choice and mongodb
- Prevent $anchorScroll from modifying the url
- Routing to sub routing module without lazy loading
When using annotations, you can define multiple routes. Like that:
I'm using Version 2.0.9
Annotations example for routes with parameters :
Then generate route in twig like this :
or
or
Do you mean placeholders with requirements?
Here you have multiple routes defined by a placeholder, validated by regular expressions going to the same controller action.
Edit:
Each part of the url can be a placeholder.