@@ -882,7 +882,8 @@ and in route imports. Symfony defines some special attributes with the same name
882882 .. code-block :: php-annotations
883883
884884 // src/Controller/ArticleController.php
885-
885+ namespace App\Controller;
886+
886887 // ...
887888 class ArticleController extends AbstractController
888889 {
@@ -969,6 +970,9 @@ the controllers of the routes:
969970
970971 .. code-block :: php-annotations
971972
973+ // src/Controller/BlogController.php
974+ namespace App\Controller;
975+
972976 use Symfony\Component\Routing\Annotation\Route;
973977
974978 class BlogController
@@ -1039,6 +1043,9 @@ A possible solution is to change the parameter requirements to be more permissiv
10391043
10401044 .. code-block :: php-annotations
10411045
1046+ // src/Controller/DefaultController.php
1047+ namespace App\Controller;
1048+
10421049 use Symfony\Component\Routing\Annotation\Route;
10431050
10441051 class DefaultController
@@ -1123,7 +1130,9 @@ the common configuration using options when importing the routes.
11231130.. configuration-block ::
11241131
11251132 .. code-block :: php-annotations
1126-
1133+ // src/Controller/BlogController.php
1134+ namespace App\Controller;
1135+
11271136 use Symfony\Component\Routing\Annotation\Route;
11281137
11291138 /**
@@ -1140,7 +1149,7 @@ the common configuration using options when importing the routes.
11401149 }
11411150
11421151 /**
1143- * @Route("/{_locale}/posts/{slug}", name="post ")
1152+ * @Route("/{_locale}/posts/{slug}", name="show ")
11441153 */
11451154 public function show(Post $post)
11461155 {
@@ -1216,7 +1225,7 @@ the common configuration using options when importing the routes.
12161225
12171226 In this example, the route of the ``index() `` action will be called ``blog_index ``
12181227and its URL will be ``/blog/ ``. The route of the ``show() `` action will be called
1219- ``blog_post `` and its URL will be ``/blog/{_locale}/posts/{slug} ``. Both routes
1228+ ``blog_show `` and its URL will be ``/blog/{_locale}/posts/{slug} ``. Both routes
12201229will also validate that the ``_locale `` parameter matches the regular expression
12211230defined in the class annotation.
12221231
@@ -1832,6 +1841,8 @@ you only need to add an argument in the service constructor and type-hint it wit
18321841the :class: `Symfony\\ Component\\ Routing\\ Generator\\ UrlGeneratorInterface ` class::
18331842
18341843 // src/Service/SomeService.php
1844+ namespace App\Service;
1845+
18351846 use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
18361847
18371848 class SomeService
@@ -1937,6 +1948,8 @@ generate URLs. This context can be configured globally for all commands:
19371948 This information can be configured per command too::
19381949
19391950 // src/Command/SomeCommand.php
1951+ namespace App\Command;
1952+
19401953 use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
19411954 use Symfony\Component\Routing\RouterInterface;
19421955 // ...
@@ -2069,7 +2082,7 @@ each route explicitly:
20692082 # config/routes.yaml
20702083 login :
20712084 path : /login
2072- controller : App\Controller\SeurityController ::login
2085+ controller : App\Controller\SecurityController ::login
20732086 schemes : [https]
20742087
20752088 .. code-block :: xml
0 commit comments