Class Dispatcher
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\Dispatcher implements ICanBoogie\HTTP\DispatcherInterface
Methods summary
protected
dispatch( ICanBoogie\Routing\Route
$route
, ICanBoogie\HTTP\Request $request
)
: ICanBoogie\HTTP\Response|null
Dispatches the route.
protected
respond( ICanBoogie\Routing\Route
$route
, ICanBoogie\HTTP\Request $request
)
: ICanBoogie\HTTP\Response|mixed
Returns a response for the route and request.
public
rescue( ICanBoogie\Routing\Exception
$exception
, ICanBoogie\HTTP\Request $request
)
: ICanBoogie\HTTP\Response
Fires \ICanBoogie\Routing\Dispatcher\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.