File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
user_guide_src/source/incoming Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,9 @@ Specifying Route Handlers
85
85
Controller's Namespace
86
86
----------------------
87
87
88
- If a controller name is stated without beginning with ``\ ``, the :ref: `routing-default-namespace ` will be prepended:
88
+ When you specify a controller and method name as a string, if a controller is
89
+ written without a leading ``\ ``, the :ref: `routing-default-namespace ` will be
90
+ prepended:
89
91
90
92
.. literalinclude :: routing/063.php
91
93
@@ -114,6 +116,17 @@ Or using ``use`` keyword:
114
116
.. literalinclude :: routing/014.php
115
117
:lines: 2-
116
118
119
+ If you forget to add ``use App\Controllers\Home; ``, the controller classname is
120
+ interpreted as ``Config\Home ``, not ``App\Controllers\Home `` because
121
+ **app/Config/Routes.php ** has ``namespace Config; `` at the top.
122
+
123
+ .. note :: When you use Array Callable Syntax, the classname is always interpreted
124
+ as a fully qualified classname. So :ref: `routing-default-namespace ` and
125
+ :ref: `namespace option <assigning-namespace >` have no effect.
126
+
127
+ Array Callable Syntax and Placeholders
128
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
129
+
117
130
If there are placeholders, it will automatically set the parameters in the specified order:
118
131
119
132
.. literalinclude :: routing/015.php
You can’t perform that action at this time.
0 commit comments