File tree 1 file changed +17
-1
lines changed
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
72
72
return [
73
73
'|^trader/(.*)/$|' => 'MyVendor\\MyApp\\Controller\\TraderController',
74
74
'|^ajax/(.*)$|' => 'MyVendor\\MyApp\\Controller\\AjaxController',
75
- '||' => 'MyVendor\\MyApp\\Controller\\IndexHandler ',
75
+ '||' => 'MyVendor\\MyApp\\Controller\\IndexController ',
76
76
];
77
77
78
78
The strings * matched* by the paranthesis of the regular expressions will be passed to the Controller as ` $params ` .
79
79
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.
80
96
81
97
### callable routing
82
98
You can’t perform that action at this time.
0 commit comments