@@ -18,25 +18,26 @@ knows to use it.
1818
1919Use the ``service_id::method_name `` syntax to refer to the controller method.
2020If the service id is the fully-qualified class name (FQCN) of your controller,
21- as Symfony recommends, then you can use something like:
22- ``App\Controller\HelloController::index ``:
21+ as Symfony recommends, then the syntax is the same as if the controller was not
22+ a service like: ``App\Controller\HelloController::index ``:
2323
2424.. configuration-block ::
2525
2626 .. code-block :: php-annotations
2727
2828 // src/Controller/HelloController.php
2929
30- // You need to use Sensio's annotation to specify a service id
31- use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
32- // ...
30+ use Symfony\Component\Routing\Annotation\Route;
3331
34- /**
35- * @Route(service="App\Controller\HelloController::index")
36- */
3732 class HelloController
3833 {
39- // ...
34+ /**
35+ * @Route("/hello", name="hello")
36+ */
37+ public function index()
38+ {
39+ // ...
40+ }
4041 }
4142
4243 .. code-block :: yaml
@@ -75,7 +76,7 @@ Invokable Controllers
7576
7677If your controller implements the ``__invoke() `` method - popular with the
7778Action-Domain-Response (ADR) pattern, you can simply refer to the service id
78- (``App\Controller\HelloController `` for example).
79+ without the method (``App\Controller\HelloController `` for example).
7980
8081Alternatives to base Controller Methods
8182---------------------------------------
@@ -89,7 +90,7 @@ The base `Controller class source code`_ is a great way to see how to accomplish
8990common tasks. For example, ``$this->render() `` is usually used to render a Twig
9091template and return a Response. But, you can also do this directly:
9192
92- In a controller that's defined as a service, you can instead inject the ``templating ``
93+ In a controller that's defined as a service, you can instead inject the ``twig ``
9394service and use it directly::
9495
9596 // src/Controller/HelloController.php
0 commit comments