-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Precision about dependency injection resolving #8085
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
The resolving of dependency injection in a Controller action is available if the controller is defined as a service. I think this comportment have to be more explicit in this documentation's part to prevent some user's incomprehension.
I think adding a note like this is a good idea... but we should probably add it in a bunch of different places where we suddenly autowire a controller argument like this (we could remove those notes in a few versions). For the note, how about:
What do you guys think about the wording? If we like it, we should really repeat this in other places. |
I totally agree with your wording. Less clumsy than mine! |
@@ -157,6 +157,10 @@ Great! Next, add the logic to ``loginAction()`` that displays the login form:: | |||
)); | |||
} | |||
|
|||
Please note that the controller autoresolve the AuthenticationUtils injection | |||
only if defined as a service. Since Symfony 3.3, this comportment is adopted |
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.
maybe behavior
sounds more familar then comportment
?
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.
@OskarStark yes you're right. My english skills are sometimes a little bit poor ;)
But my sentence should be replaced by the one given by @weaverryan so no problem
@JasonBenett Do you think you can make the change Ryan suggested? And possibly also add it in other places where we now make use of the controller being registered as a service. |
@JasonBenett thanks for this contribution! Sadly, Symfony 3.3 was deprecated before we could merge this ... so I've opened #9235 to merge this in 3.4 branch instead. In any case, thanks for helping us realize that this needed further explanation! |
The resolving of dependency injection in a Controller action is available if the controller is defined as a service. I think this comportment have to be more explicit in this documentation's part to prevent some user's incomprehension.