Skip to content

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

Conversation

richardmiller-zz
Copy link
Contributor

Q A
Doc fix? yes
New docs? no
Applies to all

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?

}

This is documented in the :doc:`/bundles/SensioFrameworkExtraBundle/annotations/routing`
chapter.
Copy link
Member

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)

Copy link
Contributor Author

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.

@weaverryan
Copy link
Member

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!

weaverryan added a commit that referenced this pull request Jun 30, 2013
@weaverryan
Copy link
Member

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants