Skip to content

Commit e49b0db

Browse files
committed
minor #17400 [Routing] Fix syntax for loading PSR-4 routes from PHP files (derrabus)
This PR was merged into the 6.2 branch. Discussion ---------- [Routing] Fix syntax for loading PSR-4 routes from PHP files see symfony/symfony#48010 Commits ------- b3709ad Fix syntax for loading PSR-4 routes from PHP files
2 parents 16458fc + b3709ad commit e49b0db

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

routing/custom_route_loader.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Symfony provides several route loaders for the most common needs:
6565
6666
<!-- loads routes from the PHP attributes of the controllers found in the given PSR-4 namespace root -->
6767
<import type="attribute">
68-
<resource path="../src/Controller/" namespace="App\Controller" />
68+
<resource path="../src/Controller/" namespace="App\Controller"/>
6969
</import>
7070
7171
<!-- loads routes from the PHP attributes of the controllers found in that directory -->
@@ -92,7 +92,10 @@ Symfony provides several route loaders for the most common needs:
9292
9393
// loads routes from the PHP attributes (#[Route(...)])
9494
// of the controllers found in the given PSR-4 namespace root
95-
$routes->import('../src/Controller/', 'attribute@App\Controller');
95+
$routes->import(
96+
['path' => '../src/Controller/', 'namespace' => 'App\Controller'],
97+
'attribute',
98+
);
9699
97100
// loads routes from the PHP attributes (#[Route(...)])
98101
// of the controllers found in that directory

0 commit comments

Comments
 (0)