-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Discourage the use of controllers as services #6611
Conversation
@@ -4,31 +4,40 @@ | |||
How to Define Controllers as Services | |||
===================================== | |||
|
|||
.. caution:: | |||
|
|||
Defining controllers as services is **not officially recommended** by Symfony. |
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 wouldn't add this caution
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.
In my opinion it's needed for newcomers.
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. |
On second read, I think these changes are perfect. 👍 status: reviewed |
Thanks Javier! |
…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
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.