From cf7ab9dc1ef4e4bc6a21799f01a35f2abc7db769 Mon Sep 17 00:00:00 2001
From: kenjis
Date: Sat, 10 Feb 2024 11:03:27 +0900
Subject: [PATCH 1/4] docs: add sample code to get URI segments
---
user_guide_src/source/incoming/routing/069.php | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/user_guide_src/source/incoming/routing/069.php b/user_guide_src/source/incoming/routing/069.php
index 991aa5c57b74..24d6366840a3 100644
--- a/user_guide_src/source/incoming/routing/069.php
+++ b/user_guide_src/source/incoming/routing/069.php
@@ -4,7 +4,10 @@
// Would execute the show404 method of the App\Errors class
$routes->set404Override('App\Errors::show404');
-// Will display a custom view
+// Will display a custom view.
$routes->set404Override(static function () {
- echo view('my_errors/not_found.html');
+ // If you want to get the URI segments.
+ $segments = request()->getUri()->getSegments();
+
+ return view('my_errors/not_found.html');
});
From d7a4ba2daa2079cc540a9fa6240dc7e2bbcf6f50 Mon Sep 17 00:00:00 2001
From: kenjis
Date: Tue, 13 Feb 2024 16:00:24 +0900
Subject: [PATCH 2/4] refactor: use official user guide URLs
---
app/Views/welcome_message.php | 4 ++--
system/Debug/Toolbar/Views/_config.tpl | 2 +-
system/Session/Handlers/BaseHandler.php | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/Views/welcome_message.php b/app/Views/welcome_message.php
index 86a6e39de305..38b3c974c0c7 100644
--- a/app/Views/welcome_message.php
+++ b/app/Views/welcome_message.php
@@ -214,7 +214,7 @@
-
diff --git a/system/Debug/Toolbar/Views/_config.tpl b/system/Debug/Toolbar/Views/_config.tpl
index b6c7e0c3d86f..e3235ec35b3f 100644
--- a/system/Debug/Toolbar/Views/_config.tpl
+++ b/system/Debug/Toolbar/Views/_config.tpl
@@ -1,5 +1,5 @@
- Read the CodeIgniter docs...
+ Read the CodeIgniter docs...
diff --git a/system/Session/Handlers/BaseHandler.php b/system/Session/Handlers/BaseHandler.php
index 086cdc2f2276..572ec9070576 100644
--- a/system/Session/Handlers/BaseHandler.php
+++ b/system/Session/Handlers/BaseHandler.php
@@ -41,7 +41,7 @@ abstract class BaseHandler implements SessionHandlerInterface
* Cookie prefix
*
* The Config\Cookie::$prefix setting is completely ignored.
- * See https://codeigniter4.github.io/CodeIgniter4/libraries/sessions.html#session-preferences
+ * See https://codeigniter.com/user_guide/libraries/sessions.html#session-preferences
*
* @var string
*/
From 654c5d740fb70d5be4f02e3905621beecf2828fd Mon Sep 17 00:00:00 2001
From: kenjis
Date: Tue, 13 Feb 2024 16:01:00 +0900
Subject: [PATCH 3/4] refactor: use official site URL
---
app/Views/welcome_message.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/Views/welcome_message.php b/app/Views/welcome_message.php
index 38b3c974c0c7..919629fc77ef 100644
--- a/app/Views/welcome_message.php
+++ b/app/Views/welcome_message.php
@@ -218,7 +218,7 @@
From 9758f907c42dd3f7c1d0bd364341166e2a49cb29 Mon Sep 17 00:00:00 2001
From: kenjis
Date: Wed, 14 Feb 2024 06:48:39 +0900
Subject: [PATCH 4/4] docs: fix config filename routes.php
---
user_guide_src/source/general/common_functions.rst | 2 +-
user_guide_src/source/helpers/url_helper.rst | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/user_guide_src/source/general/common_functions.rst b/user_guide_src/source/general/common_functions.rst
index bebf3cb3eaad..46e433158d0d 100755
--- a/user_guide_src/source/general/common_functions.rst
+++ b/user_guide_src/source/general/common_functions.rst
@@ -383,7 +383,7 @@ Miscellaneous Functions
:returns: a route path (URI path relative to baseURL)
:rtype: string
- .. note:: This function requires the controller/method to have a route defined in **app/Config/routes.php**.
+ .. note:: This function requires the controller/method to have a route defined in **app/Config/Routes.php**.
.. important:: ``route_to()`` returns a *route* path, not a full URI path for your site.
If your **baseURL** contains sub folders, the return value is not the same
diff --git a/user_guide_src/source/helpers/url_helper.rst b/user_guide_src/source/helpers/url_helper.rst
index 6dcd67ae9994..9278539b3aea 100644
--- a/user_guide_src/source/helpers/url_helper.rst
+++ b/user_guide_src/source/helpers/url_helper.rst
@@ -382,7 +382,7 @@ The following functions are available:
:returns: Absolute URL
:rtype: string
- .. note:: This function requires the controller/method to have a route defined in **app/Config/routes.php**.
+ .. note:: This function requires the controller/method to have a route defined in **app/Config/Routes.php**.
Builds an absolute URL to a controller method in your app. Example: