-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Adding to the controllers as services cookbook #2538
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
Adding to the controllers as services cookbook #2538
Conversation
} | ||
|
||
This is documented in the :doc:`/bundles/SensioFrameworkExtraBundle/annotations/routing` | ||
chapter. |
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.
I prefer a short tip directive (without code example) about this and a link to the sensioframeworkextra docs (make a ref so it links directly to the correct section). We should improve that documentation if the example is unclear.
(still using Controller
as a base class when using services seems wrong to me)
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.
Sure - it was like that when I got here :)
Also using controller as the base class makes no sense, didn't notice that was the case here.
Hi Richard! Thanks for taking this on - the transcript on #2433 is unfortunate, and like you say there, I'm not really sure that we can totally avoid people getting the wrong idea. The one additional thing that I'd like to see is some links from the "service_container" chapter to this document in some spot that will be (hopefully) noticeable, but not totally distracting. About the helper methods, I don't think we need to show how each of them work, but we should say (and maybe even link to the source code) that you can look at Symfony's base Controller class to see how your normal shortcuts actually work. Thanks! |
Hey Richard! I've patched this into the 2.2 branch at the following commits: And made several other modifications or additions, that are both related to this PR and to #2433: I'm going to close this PR and the related issue. If anyone sees anything else missing, let me know. Thanks! |
As per #2433, a the moment just some additional information. I will look at adding the pros and cons/reasons for doing this separately and also at interlinking to this page from more places.
I have just given one example of replacing a base controller helper method. Do we want to list them all as per my blog post or just leave it at that?