File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -72,11 +72,27 @@ If you need more flexibility you can use regular expressions for your route defi
7272 return [
7373 '|^trader/(.*)/$|' => 'MyVendor\\MyApp\\Controller\\TraderController',
7474 '|^ajax/(.*)$|' => 'MyVendor\\MyApp\\Controller\\AjaxController',
75- '||' => 'MyVendor\\MyApp\\Controller\\IndexHandler ',
75+ '||' => 'MyVendor\\MyApp\\Controller\\IndexController ',
7676 ];
7777
7878The strings * matched* by the paranthesis of the regular expressions will be passed to the Controller as ` $params ` .
7979
80+ ### subpath routing
81+
82+ If you have several routes starting with the same prefix you can group the in a subpath:
83+
84+ ` routes.php ` :
85+
86+ <?php
87+
88+ return [
89+ 'profile/%' => [
90+ '.' => 'MyVendor\\MyApp\\Controller\\ProfileSummaryController',
91+ 'edit/' => 'MyVendor\\MyApp\\Controller\\ProfileEditController',
92+ ]
93+ ];
94+
95+ You can nest subpaths with no limit and you can use parameters on each level.
8096
8197### callable routing
8298
You can’t perform that action at this time.
0 commit comments