2
votes

I need an expert suggestion. What is ideal in terms of performance and standards?

1) Defining all routes in src//Resources/config/routing.yml as suggested by Symfony base tutorial ?

OR

2) Defining routes in controllers as annotations?

Both seems to be right and working fine. My question is to justify as to which one is better for performance and fits into symfony standards more closely.

2

2 Answers

2
votes

Option 2 is how I like to do it within AppBundle per the Best Practices. http://symfony.com/doc/current/best_practices/controllers.html

However when making stand alone Bundles I make a routing config file so the user has an easier time finding the routes to over write.

0
votes

Personally i prefer standalone routing files, but then again i work with rest APIs, so it makes it much easier for my documentation and sharing api calls with the rest of the team