File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -78,16 +78,16 @@ syntax:
78
78
Invokable Controllers
79
79
---------------------
80
80
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 )::
84
84
85
85
// src/AppBundle/Controller/Hello.php
86
86
use Symfony\Component\HttpFoundation\Response;
87
87
use Symfony\Component\Routing\Annotation\Route;
88
88
89
89
/**
90
- * @Route("/hello/{name}", name="hello", service="AppBundle\Controller\Hello" )
90
+ * @Route("/hello/{name}", name="hello")
91
91
*/
92
92
class Hello
93
93
{
@@ -154,3 +154,4 @@ If you want to know what type-hints to use for each service, see the
154
154
.. _`base Controller class` : https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php
155
155
.. _`ControllerTrait` : https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php
156
156
.. _`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
You can’t perform that action at this time.
0 commit comments