From d7c7d7df950dd6b719e476db8b28e4e497ebbb3e Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 15 Nov 2017 15:51:25 +0100 Subject: [PATCH 1/3] Removed a wrong note about controllers as services --- controller/service.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/controller/service.rst b/controller/service.rst index 0dbe50e6467..c1ee636e7d3 100644 --- a/controller/service.rst +++ b/controller/service.rst @@ -102,11 +102,6 @@ defined above with the id ``app.hello_controller``:: $this->forward('app.hello_controller:indexAction', array('name' => $name)); -.. note:: - - You cannot drop the ``Action`` part of the method name when using this - syntax. - You can also route to the service by using the same notation when defining the route ``_controller`` value: From c3f66132bbdeedac90011feb21e8bcbd906db69c Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 15 Nov 2017 16:39:58 +0100 Subject: [PATCH 2/3] Reworded the note --- controller/service.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/controller/service.rst b/controller/service.rst index c1ee636e7d3..a58d4e606fc 100644 --- a/controller/service.rst +++ b/controller/service.rst @@ -102,6 +102,12 @@ defined above with the id ``app.hello_controller``:: $this->forward('app.hello_controller:indexAction', array('name' => $name)); +.. note:: + + Unlike the traditional ``Bundle:Controller:method`` notation, when using + this syntax the method name must match the original controller method name, + so you cannot remove the ``Action`` suffix if the method includes it. + You can also route to the service by using the same notation when defining the route ``_controller`` value: From 34ce2e08b2c24845538700129c1c7e22269b5a58 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 16 Nov 2017 11:33:51 +0100 Subject: [PATCH 3/3] Using Ryan's wording --- controller/service.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controller/service.rst b/controller/service.rst index a58d4e606fc..371427a2323 100644 --- a/controller/service.rst +++ b/controller/service.rst @@ -104,9 +104,9 @@ defined above with the id ``app.hello_controller``:: .. note:: - Unlike the traditional ``Bundle:Controller:method`` notation, when using - this syntax the method name must match the original controller method name, - so you cannot remove the ``Action`` suffix if the method includes it. + Make sure the method name in your route (e.g. ``indexAction``) matches the + method name exactly. Unlike the traditional ``Bundle:Controller:method`` + notation, the ``Action`` suffix is not automatically added for you. You can also route to the service by using the same notation when defining the route ``_controller`` value: