Skip to content

Commit b8feaf1

Browse files
committed
Tweaks
1 parent 6af97ec commit b8feaf1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

controller/service.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,16 @@ syntax:
7878
Invokable Controllers
7979
---------------------
8080

81-
If your controller implements the ``__invoke()`` method - popular with the
82-
Action-Domain-Response (ADR) pattern, you can simply refer to the service id
83-
(e.g. ``AppBundle\Controller\HelloController`` or ``app.hello_controller``)::
81+
Controllers can also define a single action using the ``__invoke()`` method,
82+
which is a common practice when following the `ADR pattern`_
83+
(Action-Domain-Responder)::
8484

8585
// src/AppBundle/Controller/Hello.php
8686
use Symfony\Component\HttpFoundation\Response;
8787
use Symfony\Component\Routing\Annotation\Route;
8888

8989
/**
90-
* @Route("/hello/{name}", name="hello", service="AppBundle\Controller\Hello")
90+
* @Route("/hello/{name}", name="hello")
9191
*/
9292
class Hello
9393
{
@@ -154,3 +154,4 @@ If you want to know what type-hints to use for each service, see the
154154
.. _`base Controller class`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php
155155
.. _`ControllerTrait`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php
156156
.. _`AbstractController`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php
157+
.. _`ADR pattern`: https://en.wikipedia.org/wiki/Action%E2%80%93domain%E2%80%93responder

0 commit comments

Comments
 (0)