File tree Expand file tree Collapse file tree
user_guide_src/source/incoming Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,6 +47,23 @@ You can supply multiple verbs that a route should match by passing them in as an
4747
4848.. literalinclude :: routing/004.php
4949
50+ Controller's Namespace
51+ ======================
52+
53+ If a controller name is stated without beginning with ``\ ``, the :ref: `routing-default-namespace ` will be prepended:
54+
55+ .. literalinclude :: routing/063.php
56+
57+ If you put ``\ `` at the beginning, it is treated as a fully qualified class name:
58+
59+ .. literalinclude :: routing/064.php
60+
61+ You can also specify the namespace with the ``namespace `` option:
62+
63+ .. literalinclude :: routing/038.php
64+
65+ See :ref: `assigning-namespace ` for details.
66+
5067Placeholders
5168============
5269
@@ -394,7 +411,7 @@ You specify an array for the filter value:
394411Assigning Namespace
395412-------------------
396413
397- While a default namespace will be prepended to the generated controllers (see below) , you can also specify
414+ While a :ref: ` routing- default- namespace` will be prepended to the generated controllers, you can also specify
398415a different namespace to be used in any options array, with the ``namespace `` option. The value should be the
399416namespace you want modified:
400417
@@ -480,6 +497,8 @@ Routes Configuration Options
480497The RoutesCollection class provides several options that affect all routes, and can be modified to meet your
481498application's needs. These options are available at the top of **app/Config/Routes.php **.
482499
500+ .. _routing-default-namespace :
501+
483502Default Namespace
484503=================
485504
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ // Routes to \App\Controllers\Users::index()
4+ $ routes ->get ('users ' , 'Users::index ' );
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ // Routes to \Acme\Blog\Controllers\Home::list()
4+ $ routes ->get ('blog ' , '\Acme\Blog\Controllers\Home::list ' );
You can’t perform that action at this time.
0 commit comments