Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb3709ad

Browse files
committed
Fix syntax for loading PSR-4 routes from PHP files
1 parent18397ef commitb3709ad

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
<importtype="attribute">
68-
<resourcepath="../src/Controller/"namespace="App\Controller"/>
68+
<resourcepath="../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)

[8]ページ先頭

©2009-2025 Movatter.jp