Skip to content

Commit dcad1b3

Browse files
committed
Fix syntax for loading PSR-4 routes from PHP files
1 parent 18397ef commit dcad1b3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

routing/custom_route_loader.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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)