From cf7ab9dc1ef4e4bc6a21799f01a35f2abc7db769 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 10 Feb 2024 11:03:27 +0900 Subject: [PATCH] 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'); });