I am trying to understand symfony's routing system.
In app/config/routing.yml, I have two routing configurations from two different bundles '
firstbundle:
resource: "@FirstBundle/Resources/config/routing.yml"
prefix: /api
secondbundle:
resource: "@SecondBundle/Resources/config/routing.yml"
prefix: /api
`
So if I am making a request like,
https://example.com/app.php/api/images/ (defined in first bundle config)
or
https://example.com/app.php/api/views/ (defined in second bundle config)
How does the router decide which bundle to use?
Suppose I am going to access api./views, in this case will it also check within FirstBundle routing config? My doubt is regarding the routing flow. Does router traverse through every bundle configurations?
Routes, as other configuration parameters, are parsed in the same order they appear in your file.
That means that if two identical routes (keys, speaking more in general) are defined, the first one defined (and so parsed) is the one that is taken.
If you're worry about performances, I can tell that this is not something you should worry about (them are cached)