V
V
Vladislav2016-07-18 23:17:37
symfony
Vladislav, 2016-07-18 23:17:37

Why doesn't Symfony use routing.yml from the bundle?

For the bundle, AppBudle has created a new TermsController controller. Symfony automatically created /AppBundle/Resources/config/routing.yml which has a route:
get_terms:
path: /{term}
defaults: { _controller: AppBundle:TermsController:getTerms }
But checking php bin/console debug:route shows that Symfony does not see this route.
If you add it to the main /app/config/routing.yml then everything works. Why doesn't Symfony include routes from the bundle?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Vapelnik, 2016-07-18
@MrBikus

the new route config (in the bundle src/AppBundle/Resources/config/routing.yml) needs to be imported into the main route config (in app/config/routing.yml): symfony.com/doc/2.8/book/routing.html #including ex...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question