-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpKernel] Controller Attributes #45457
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
namespace Symfony\Component\HttpKernel\Attribute; | ||
|
||
/** | ||
* Marker interface for controller attributes |
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.
For controller argument attributes we decided to remove the marker interface, should we do the same here ?
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.
No marker at all, the same way controller argument metadata works. We might need to introduce a ControllerMetadata
class to mirror the ArgumentMetadata
one.
|
||
namespace Symfony\Component\HttpKernel\EventListener; | ||
|
||
use Doctrine\Persistence\Proxy; |
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.
relevant?
I'm closing in favor of #46001, which should provide a better starting point for the goal we have. |
… handle attributes on controllers (nicolas-grekas) This PR was squashed before being merged into the 6.2 branch. Discussion ---------- [HttpKernel] Add `ControllerEvent::getAttributes()` to handle attributes on controllers | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Replacing #45457. Paving the way toward #44705 Commits ------- 0f2293c [HttpKernel] Add `ControllerEvent::getAttributes()` to handle attributes on controllers
In a continuation of efforts to deprecate SensioFrameworkExtraBundle (#45415), this PR adds a mechanism to parse controller attributes at the request of @nicolas-grekas.
This is a rewrite of the ControllerListener from SensioFrameworkExtraBundle with support for annotations dropped.
The only thing I haven't implemented is a configuration option in FrameworkBundle to enable/disable support. I'm thinking of either
framework.controller.controller_attributes
orframework.request.controller_attributes
, any suggestions?