Skip to content
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

Discourage the use of controllers as services #6611

Closed

Conversation

javiereguiluz
Copy link
Member

As briefly discussed during the past Docs Hack Day, the official Symfony opinion about "controllers as services" is very clear: don't do it, unless you know well what you are doing.

I propose to remove most of the mentions to "controllers as services" to not confuse readers about something we don't want them to use.

@@ -4,31 +4,40 @@
How to Define Controllers as Services
=====================================

.. caution::

Defining controllers as services is **not officially recommended** by Symfony.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't add this caution

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion it's needed for newcomers.

@javiereguiluz
Copy link
Member Author

Could we move this PR forward? @wouterj if you like we can reword the caution note, but I'd like to clearly say "don't use this ... unless you know what you are doing". Experts will skip this note anyway, but newcomers need strong advice from us.

@wouterj
Copy link
Member

wouterj commented Jul 2, 2016

On second read, I think these changes are perfect. 👍

status: reviewed

@weaverryan
Copy link
Member

Thanks Javier!

weaverryan added a commit that referenced this pull request Jul 10, 2016
…uiluz)

This PR was submitted for the 2.3 branch but it was merged into the 2.7 branch instead (closes #6611).

Discussion
----------

Discourage the use of controllers as services

As briefly discussed during the past Docs Hack Day, the official Symfony opinion about "controllers as services" is very clear: don't do it, unless you know well what you are doing.

I propose to remove most of the mentions to "controllers as services" to not confuse readers about something we don't want them to use.

Commits
-------

a1847fb Minor fix
deaa5fc Fixed typo
abc7cf3 Discourage the use of controllers as services
@weaverryan weaverryan closed this Jul 10, 2016
@javiereguiluz javiereguiluz deleted the tweak_controllers_services branch May 24, 2018 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants