Class RouteDispatcher
Dispatch requests among the defined routes.
If a route matching the request is found, the $route
and $decontextualized_path
properties are added to the ICanBoogie\HTTP\Request instance. $route
holds the ICanBoogie\Routing\Route
instance,
$decontextualized_path
holds the decontextualized path. The path is decontextualized using
the decontextualize() function.
- ICanBoogie\Routing\RouteDispatcher implements ICanBoogie\HTTP\Dispatcher uses ICanBoogie\Accessor\AccessorTrait (not available)
Methods summary
protected
|
|
public
|
|
public
ICanBoogie\HTTP\Response|null
|
|
protected
string
|
|
protected
false|
|
#
resolve_route( ICanBoogie\HTTP\Request $request, string $normalized_path, array & $captured )
Resolves route from request. |
protected
|
#
alter_params(
Alters request parameters. |
protected
|
#
alter_context( ICanBoogie\HTTP\Request\Context $context,
Alters request context with route and controller. |
protected
ICanBoogie\HTTP\Response|null
|
#
dispatch(
Dispatches the route. |
protected
ICanBoogie\HTTP\Response|mixed
|
#
respond(
Returns a response for the route and request. |
public
ICanBoogie\HTTP\Response
|
#
rescue(
Fires \ICanBoogie\Routing\RouteDispatcher\RescueEvent and returns the response provided by third parties. If no response was provided, the exception (or the exception provided by third parties) is re-thrown. |
Properties summary
protected
|
$routes
Route collection. |
Magic properties
public read-only
|
$routes
|