File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -78,9 +78,9 @@ a service like: ``App\Controller\HelloController::index``:
7878
7979 # config/routes.yaml
8080 hello :
81- path : /hello
81+ path : /hello
8282 controller : App\Controller\HelloController::index
83- methods : GET
83+ methods : GET
8484
8585 .. code-block :: xml
8686
@@ -140,8 +140,8 @@ which is a common practice when following the `ADR pattern`_
140140
141141 # config/routes.yaml
142142 hello :
143- path : /hello/{name}
144- controller : app.hello_controller
143+ path : /hello/{name}
144+ controller : App\Controller\HelloController
145145
146146 .. code-block :: xml
147147
@@ -153,16 +153,18 @@ which is a common practice when following the `ADR pattern`_
153153 https://symfony.com/schema/routing/routing-1.0.xsd" >
154154
155155 <route id =" hello" path =" /hello/{name}" >
156- <default key =" _controller" >app.hello_controller </default >
156+ <default key =" _controller" >App\Controller\HelloController </default >
157157 </route >
158158
159159 </routes >
160160
161161 .. code-block :: php
162162
163+ use App\Controller\HelloController;
164+
163165 // app/config/routing.php
164166 $collection->add('hello', new Route('/hello', [
165- '_controller' => 'app.hello_controller' ,
167+ '_controller' => HelloController::class ,
166168 ]));
167169
168170 Alternatives to base Controller Methods
You can’t perform that action at this time.
0 commit comments