From 18ccf29bedecbc76f0bf7a54301f486a3932e282 Mon Sep 17 00:00:00 2001 From: Jason Benedetti Date: Mon, 26 Jun 2017 00:46:40 +0200 Subject: [PATCH] Precision about dependency injection resolving 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. --- security/form_login_setup.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/security/form_login_setup.rst b/security/form_login_setup.rst index d8974204634..0cd11eee4a7 100644 --- a/security/form_login_setup.rst +++ b/security/form_login_setup.rst @@ -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 +by default in the services.yml file. + Don't let this controller confuse you. As you'll see in a moment, when the user submits the form, the security system automatically handles the form submission for you. If the user submits an invalid username or password,