From 65cb4d56e4130cd8bdc0a83a44d56bb92b08b093 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 15 Dec 2023 10:40:07 +0900 Subject: [PATCH 1/3] docs: update config sample --- user_guide_src/source/incoming/controllers.rst | 16 +++++++++------- .../source/incoming/controllers/015.php | 3 --- 2 files changed, 9 insertions(+), 10 deletions(-) delete mode 100644 user_guide_src/source/incoming/controllers/015.php diff --git a/user_guide_src/source/incoming/controllers.rst b/user_guide_src/source/incoming/controllers.rst index 1f75bc872c9e..16296848f7c1 100644 --- a/user_guide_src/source/incoming/controllers.rst +++ b/user_guide_src/source/incoming/controllers.rst @@ -313,16 +313,17 @@ Defining a Default Controller Let's try it with the ``Helloworld`` controller. -To specify a default controller open your **app/Config/Routes.php** -file and set this variable: +To specify a default controller open your **app/Config/Routing.php** +file and set this property:: -.. literalinclude:: controllers/015.php + public string $defaultController = 'Helloworld'; Where ``Helloworld`` is the name of the controller class you want to be used. -A few lines further down **Routes.php** in the "Route Definitions" section, comment out the line: +And comment out the line in **app/Config/Routes.php**: .. literalinclude:: controllers/016.php + :lines: 2- If you now browse to your site without specifying any URI segments you'll see the "Hello World" message. @@ -547,15 +548,16 @@ Defining a Default Controller (Legacy) Let's try it with the ``Helloworld`` controller. To specify a default controller open your **app/Config/Routes.php** -file and set this variable: +file and set this property:: -.. literalinclude:: controllers/015.php + public string $defaultController = 'Helloworld'; Where ``Helloworld`` is the name of the controller class you want to be used. -A few lines further down **Routes.php** in the "Route Definitions" section, comment out the line: +And comment out the line in **app/Config/Routes.php**: .. literalinclude:: controllers/016.php + :lines: 2- If you now browse to your site without specifying any URI segments you'll see the "Hello World" message. diff --git a/user_guide_src/source/incoming/controllers/015.php b/user_guide_src/source/incoming/controllers/015.php deleted file mode 100644 index 2de1b716d040..000000000000 --- a/user_guide_src/source/incoming/controllers/015.php +++ /dev/null @@ -1,3 +0,0 @@ -setDefaultController('Helloworld'); From 9c3f1f763b8adf6952245c2882e8f47b01b27ba8 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 15 Dec 2023 10:40:40 +0900 Subject: [PATCH 2/3] docs: remove incorrect links --- user_guide_src/source/incoming/controllers.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/user_guide_src/source/incoming/controllers.rst b/user_guide_src/source/incoming/controllers.rst index 16296848f7c1..0ba3656b2930 100644 --- a/user_guide_src/source/incoming/controllers.rst +++ b/user_guide_src/source/incoming/controllers.rst @@ -333,8 +333,8 @@ see the "Hello World" message. precedence over Auto Routing, and controllers defined in the defined routes are denied access by Auto Routing (Improved) for security reasons. -For more information, please refer to the :ref:`routes-configuration-options` section of the -:ref:`URI Routing ` documentation. +For more information, please refer to the +:ref:`routing-auto-routing-improved-configuration-options` documentation. .. _controller-default-method-fallback: @@ -564,8 +564,8 @@ see the "Hello World" message. .. note:: The line ``$routes->get('/', 'Home::index');`` is an optimization that you will want to use in a "real-world" app. But for demonstration purposes we don't want to use that feature. ``$routes->get()`` is explained in :doc:`URI Routing ` -For more information, please refer to the :ref:`routes-configuration-options` section of the -:ref:`URI Routing ` documentation. +For more information, please refer to the the +:ref:`routing-auto-routing-legacy-configuration-options` documentation. Organizing Your Controllers into Sub-directories (Legacy) ========================================================= From 6ceb0fb61167b8030be37c2ea8e8371a30df32a0 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 15 Dec 2023 11:20:27 +0900 Subject: [PATCH 3/3] docs: update routing config file name --- user_guide_src/source/incoming/controllers.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/user_guide_src/source/incoming/controllers.rst b/user_guide_src/source/incoming/controllers.rst index 0ba3656b2930..b1aa0e65a9a5 100644 --- a/user_guide_src/source/incoming/controllers.rst +++ b/user_guide_src/source/incoming/controllers.rst @@ -416,7 +416,7 @@ To call the above controller your URI will look something like this:: Each of your sub-directories may contain a default controller which will be called if the URL contains *only* the sub-directory. Simply put a controller in there that matches the name of your default controller as specified in -your **app/Config/Routes.php** file. +your **app/Config/Routing.php** file. CodeIgniter also permits you to map your URIs using its :ref:`Defined Route Routing `.. @@ -547,7 +547,7 @@ Defining a Default Controller (Legacy) Let's try it with the ``Helloworld`` controller. -To specify a default controller open your **app/Config/Routes.php** +To specify a default controller open your **app/Config/Routing.php** file and set this property:: public string $defaultController = 'Helloworld'; @@ -595,7 +595,7 @@ To call the above controller your URI will look something like this:: Each of your sub-directories may contain a default controller which will be called if the URL contains *only* the sub-directory. Simply put a controller in there that matches the name of your default controller as specified in -your **app/Config/Routes.php** file. +your **app/Config/Routing.php** file. CodeIgniter also permits you to map your URIs using its :ref:`Defined Route Routing `..