Skip to content

Commit f3b5b38

Browse files
committed
Merge branch '6.0' into 6.1
* 6.0: Replace service name with FQCN class reference
2 parents 4ae7e97 + 8a3b774 commit f3b5b38

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

controller/service.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)