New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically load routes in app controllers #6513
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also automatically add the controller.service_arguments
tag for src/Controller
services, should we not? Otherwise you cannot use DI in your controllers.
I don't think that's related, that's a configuration of your service. I would usually use |
But the point of this PR is to automatically have route configuration available via annotations available for your controllers in But yes, you can of course add |
I don't see that as the same thing. This is route registration. The other thing is "make this class public and allow action injection". You can use one without the other, and you don't need add config files now in either way. |
Thank you @aschempp. |
If you have controllers with Symfony routes, you currently need to manually add a
routes.yaml
to your project to load that folder. This would automatically load controller routes if noroutes.yaml
exists. Loading both is problematic because they could override each other.