File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -76,13 +76,6 @@ Then you can define it as a service as follows:
7676 'AppBundle\Controller\HelloController'
7777 ));
7878
79- .. caution ::
80-
81- If you are managing your routes with PHP annotation, you may need to add an
82- ``@Route `` annotation to the controller-class which specifies its service
83- ID. If you don't, the system may try to construct your controller without
84- any arguments. See the `FrameworkExtraBundle documentation `_ for details.
85-
8679 Referring to the Service
8780------------------------
8881
@@ -126,7 +119,8 @@ the route ``_controller`` value:
126119 .. tip ::
127120
128121 You can also use annotations to configure routing using a controller
129- defined as a service. See the `FrameworkExtraBundle documentation `_ for
122+ defined as a service. Make sure you specify the service ID in the
123+ ``@Route `` annotation. See the `FrameworkExtraBundle documentation `_ for
130124 details.
131125
132126.. tip ::
@@ -345,4 +339,4 @@ controller:
345339
346340.. _`Controller class source code` : https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php
347341.. _`base Controller class` : https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php
348- .. _`FrameworkExtraBundle documentation` : https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/routing.html
342+ .. _`FrameworkExtraBundle documentation` : https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/routing.html#controller-as-service
You can’t perform that action at this time.
0 commit comments