Is there any difference in using annotation routes or group routes in symfony 2 when it comes to performance, convenience, maintainability or in any aspect that would make the other more advisable to use?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use SensioFrameworkExtraBundle, already shipped with Symfony 2. Having route names and paths in the same place of controller action is the right way to go. If you want to modify a path or action name simply go to that action, without editing
routing.yml.Then give a name to your “grouped routes” e.g.
bundle_controllerpattern or maybebundle_entity(if controller is used for CRUD on a single entity):Eventually prefixing all paths defined by annotations (add
prefix: /my/path/prefix).EDIT: don’t know anything about performances. I’m talking only about convenience.