Skip to content

Commit cf7ab9d

Browse files
committed
docs: add sample code to get URI segments
1 parent d7449f6 commit cf7ab9d

File tree

1 file changed

+5
-2
lines changed
  • user_guide_src/source/incoming/routing

1 file changed

+5
-2
lines changed

user_guide_src/source/incoming/routing/069.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
// Would execute the show404 method of the App\Errors class
55
$routes->set404Override('App\Errors::show404');
66

7-
// Will display a custom view
7+
// Will display a custom view.
88
$routes->set404Override(static function () {
9-
echo view('my_errors/not_found.html');
9+
// If you want to get the URI segments.
10+
$segments = request()->getUri()->getSegments();
11+
12+
return view('my_errors/not_found.html');
1013
});

0 commit comments

Comments
 (0)