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
8585Controller's Namespace
8686----------------------
8787
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:
8991
9092.. literalinclude :: routing/063.php
9193
@@ -114,6 +116,17 @@ Or using ``use`` keyword:
114116.. literalinclude :: routing/014.php
115117 :lines: 2-
116118
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+
117130If there are placeholders, it will automatically set the parameters in the specified order:
118131
119132.. literalinclude :: routing/015.php
You can’t perform that action at this time.
0 commit comments