Class RoutingMiddleware
Applies routing rules to the request and creates the controller instance if possible.
Namespace: Cake\Routing\Middleware
Constants
-
string
ROUTE_COLLECTION_CACHE_KEY ¶'routeCollection'
Key used to store the route collection in the cache engine
Property Summary
-
$app protected
Cake\Routing\RoutingApplicationInterface
The application that will have its routing hook invoked.
Method Summary
-
__construct() public
Constructor
-
loadRoutes() protected
Trigger the application's and plugin's routes() hook.
-
process() public
Apply routing and update the request.
Method Detail
__construct() ¶ public
__construct(Cake\Routing\RoutingApplicationInterface $app)
Constructor
Parameters
-
Cake\Routing\RoutingApplicationInterface
$app The application instance that routes are defined on.
loadRoutes() ¶ protected
loadRoutes(): void
Trigger the application's and plugin's routes() hook.
Returns
void
process() ¶ public
process(ServerRequestInterface $request, RequestHandlerInterface $handler): Psr\Http\Message\ResponseInterface
Apply routing and update the request.
Any route/path specific middleware will be wrapped around $next and then the new middleware stack will be invoked.
Parameters
-
ServerRequestInterface
$request The request.
-
RequestHandlerInterface
$handler The request handler.
Returns
Psr\Http\Message\ResponseInterface
Property Detail
$app ¶ protected
The application that will have its routing hook invoked.
Type
Cake\Routing\RoutingApplicationInterface