The Valvoid\Maze\Maze
object is the runtime entry point of the router.
It resolves the incoming request against the defined routes and provides
access to the matched route and its data.
use Valvoid\Box\Box;
use Valvoid\Maze\Maze;
$box = new Box;
$maze = $box->get(Maze::class);
Route Method
The Maze object provides access to the resolved route of the current request:
$route = $maze->getRoute();
Route Object Methods
$route->getStatusCode();
Returns the status code of the matched route:
200
if a route matched404
if no route matched405
if the method is not allowed
$route->getEntry();
Returns entry.
$route->getArguments();
Returns extracted parameters.
Note
If the status code is 404
or 405
, both getEntry()
and
getArguments()
return null
.