From 78b5156d1114dfc6de65f70eb464b4cbb366b355 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 14 Jun 2023 07:52:33 +0900 Subject: [PATCH 1/8] docs: remove redundant note --- user_guide_src/source/incoming/routing.rst | 3 --- 1 file changed, 3 deletions(-) diff --git a/user_guide_src/source/incoming/routing.rst b/user_guide_src/source/incoming/routing.rst index 0ccb9ae9ab6b..a7f3050d4538 100644 --- a/user_guide_src/source/incoming/routing.rst +++ b/user_guide_src/source/incoming/routing.rst @@ -333,9 +333,6 @@ available from the command line: .. warning:: If you enable :ref:`auto-routing-legacy` and place the command file in **app/Controllers**, anyone could access the command with the help of Auto Routing (Legacy) via HTTP. -.. note:: It is recommended to use Spark Commands instead of CLI routes. - See the :doc:`../cli/spark_commands` page for detailed information. - Global Options ************** From e431447c51e06703159125ce706475cd76330835 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 14 Jun 2023 07:54:07 +0900 Subject: [PATCH 2/8] docs: move note up --- user_guide_src/source/incoming/routing.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/user_guide_src/source/incoming/routing.rst b/user_guide_src/source/incoming/routing.rst index a7f3050d4538..85efe01fe3c1 100644 --- a/user_guide_src/source/incoming/routing.rst +++ b/user_guide_src/source/incoming/routing.rst @@ -320,6 +320,9 @@ define an array of routes and then pass it as the first parameter to the ``map() Command-Line Only Routes ======================== +.. note:: It is recommended to use Spark Commands for CLI scripts instead of calling controllers via CLI. + See the :doc:`../cli/cli_commands` page for detailed information. + You can create routes that work only from the command-line, and are inaccessible from the web browser, with the ``cli()`` method. Any route created by any of the HTTP-verb-based route methods will also be inaccessible from the CLI, but routes created by the ``add()`` method will still be @@ -327,9 +330,6 @@ available from the command line: .. literalinclude:: routing/032.php -.. note:: It is recommended to use Spark Commands for CLI scripts instead of calling controllers via CLI. - See the :doc:`../cli/cli_commands` page for detailed information. - .. warning:: If you enable :ref:`auto-routing-legacy` and place the command file in **app/Controllers**, anyone could access the command with the help of Auto Routing (Legacy) via HTTP. From 062e8d506a6d7ba334293d1b229b2eea52ebe43f Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 14 Jun 2023 08:00:22 +0900 Subject: [PATCH 3/8] docs: fix incorrect sample code (:any) matches multiple segments. --- user_guide_src/source/incoming/routing/008.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/incoming/routing/008.php b/user_guide_src/source/incoming/routing/008.php index d840165c7809..0e9c3afdafa7 100644 --- a/user_guide_src/source/incoming/routing/008.php +++ b/user_guide_src/source/incoming/routing/008.php @@ -1,3 +1,3 @@ get('product/(:any)', 'Catalog::productLookup'); +$routes->get('product/(:segment)', 'Catalog::productLookup'); From 30ffa635df374239288f6e85e7fa895d814a5091 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 14 Jun 2023 08:08:40 +0900 Subject: [PATCH 4/8] docs: use term "route path" and "route handler" --- user_guide_src/source/incoming/routing.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/user_guide_src/source/incoming/routing.rst b/user_guide_src/source/incoming/routing.rst index 85efe01fe3c1..a19efa9f5648 100644 --- a/user_guide_src/source/incoming/routing.rst +++ b/user_guide_src/source/incoming/routing.rst @@ -31,7 +31,8 @@ If you expect a GET request, you use the ``get()`` method: .. literalinclude:: routing/001.php -A route takes the URI path (``/``) on the left, and maps it to the controller and method (``Home::index``) on the right, +A route takes the **Route Path** (URI path relative to the BaseURL. ``/``) on the left, +and maps it to the **Route Handler** (controller and method ``Home::index``) on the right, along with any parameters that should be passed to the controller. The controller and method should @@ -534,7 +535,7 @@ Route Priority Routes are registered in the routing table in the order in which they are defined. This means that when a URI is accessed, the first matching route will be executed. -.. note:: If a route (the URI path) is defined more than once with different handlers, only the first defined route is registered. +.. note:: If a route path is defined more than once with different handlers, only the first defined route is registered. You can check registered routes in the routing table by running the :ref:`spark routes ` command. @@ -851,9 +852,9 @@ The output is like the following: The *Method* column shows the HTTP method that the route is listening for. -The *Route* column shows the route (URI path) to match. The route of a defined route is expressed as a regular expression. +The *Route* column shows the route path to match. The route of a defined route is expressed as a regular expression. -Since v4.3.0, the *Name* column shows the route name. ``»`` indicates the name is the same as the route. +Since v4.3.0, the *Name* column shows the route name. ``»`` indicates the name is the same as the route path. .. important:: The system is not perfect. If you use Custom Placeholders, *Filters* might not be correct. If you want to check filters for a route, you can use :ref:`spark filter:check ` command. From 61d87fa378217836db01efd87ea8d122c43294d5 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 14 Jun 2023 08:11:38 +0900 Subject: [PATCH 5/8] docs: add note in section "Auto Routing (Improved)" --- user_guide_src/source/incoming/routing.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/user_guide_src/source/incoming/routing.rst b/user_guide_src/source/incoming/routing.rst index a19efa9f5648..14abbf66a392 100644 --- a/user_guide_src/source/incoming/routing.rst +++ b/user_guide_src/source/incoming/routing.rst @@ -875,6 +875,8 @@ The *Method* will be like ``GET(auto)``. ``/..`` in the *Route* column indicates one segment. ``[/..]`` indicates it is optional. +.. note:: When auto-routing is enabled, if you have the route ``home``, it can be also accessd by ``Home``, or maybe by ``hOme``, ``hoMe``, ``HOME``, etc. But the command shows only ``home``. + If you see a route starting with ``x`` like the following, it indicates an invalid route that won't be routed, but the controller has a public method for routing. From ebaa5ea4e43b961b0857a9b79c544b2974596cd6 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 14 Jun 2023 08:14:47 +0900 Subject: [PATCH 6/8] docs: improve section title --- user_guide_src/source/incoming/routing.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide_src/source/incoming/routing.rst b/user_guide_src/source/incoming/routing.rst index 14abbf66a392..f91a282160ef 100644 --- a/user_guide_src/source/incoming/routing.rst +++ b/user_guide_src/source/incoming/routing.rst @@ -832,8 +832,8 @@ CodeIgniter has the following :doc:`command ` to display al .. _routing-spark-routes: -routes -====== +spark routes +============ Displays all routes and filters:: From 8b8da0f6a8bc53c943e7b421d17d5b7fe9f6cb7a Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 15 Jun 2023 17:01:47 +0900 Subject: [PATCH 7/8] docs: change note to warning --- user_guide_src/source/incoming/routing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/incoming/routing.rst b/user_guide_src/source/incoming/routing.rst index f91a282160ef..1642d8b97655 100644 --- a/user_guide_src/source/incoming/routing.rst +++ b/user_guide_src/source/incoming/routing.rst @@ -535,7 +535,7 @@ Route Priority Routes are registered in the routing table in the order in which they are defined. This means that when a URI is accessed, the first matching route will be executed. -.. note:: If a route path is defined more than once with different handlers, only the first defined route is registered. +.. warning:: If a route path is defined more than once with different handlers, only the first defined route is registered. You can check registered routes in the routing table by running the :ref:`spark routes ` command. From 59da1737a45fed9bb17a268c39f5e9a1169e8eed Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 15 Jun 2023 17:03:21 +0900 Subject: [PATCH 8/8] docs: fix by proofreading --- user_guide_src/source/incoming/routing.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide_src/source/incoming/routing.rst b/user_guide_src/source/incoming/routing.rst index 1642d8b97655..a5d195f53e46 100644 --- a/user_guide_src/source/incoming/routing.rst +++ b/user_guide_src/source/incoming/routing.rst @@ -875,7 +875,7 @@ The *Method* will be like ``GET(auto)``. ``/..`` in the *Route* column indicates one segment. ``[/..]`` indicates it is optional. -.. note:: When auto-routing is enabled, if you have the route ``home``, it can be also accessd by ``Home``, or maybe by ``hOme``, ``hoMe``, ``HOME``, etc. But the command shows only ``home``. +.. note:: When auto-routing is enabled and you have the route ``home``, it can be also accessed by ``Home``, or maybe by ``hOme``, ``hoMe``, ``HOME``, etc. but the command will show only ``home``. If you see a route starting with ``x`` like the following, it indicates an invalid route that won't be routed, but the controller has a public method for routing. @@ -913,7 +913,7 @@ The *Method* will be ``auto``. ``[/...]`` in the *Route* column indicates any number of segments. -.. note:: When auto-routing is enabled, if you have the route ``home``, it can be also accessd by ``Home``, or maybe by ``hOme``, ``hoMe``, ``HOME``, etc. But the command shows only ``home``. +.. note:: When auto-routing is enabled and you have the route ``home``, it can be also accessed by ``Home``, or maybe by ``hOme``, ``hoMe``, ``HOME``, etc. but the command will show only ``home``. .. _routing-spark-routes-sort-by-handler: