-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Add support for route attributes in kernel controller methods #46115
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
Conversation
489fbdc
to
1e248e2
Compare
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.
Nice :)
please add a line on the changelog of the component
we now need to update the recipe for symfony/routing 6.1
can you please send a PR ?
src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/MicroKernelTraitTest.php
Outdated
Show resolved
Hide resolved
Should we deprecate declaring routes with the |
Deprecating always has a cost, which needs to be justified. What would be the justification for the migration cost? |
The "old" syntax still has use cases: for instance, you may want to register methods as controllers dynamically (using reflection or complex things like this). I would keep it (and it has been supported for years). However, we could update the docs to promote the new syntax. |
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.
Cool
Thank you @dunglas. |
6e35580
to
0ae445c
Compare
Simplify creating single file projects using route attributes:
This will also allow removing these lines from the FrameworkBundle recipe: https://github.com/symfony/recipes/blob/master/symfony/routing/6.0/config/routes.yaml#L5-L7