Applies routing rules to the request and creates the controller instance if possible.
string
'routeCollection'
$app
protected $cacheConfig
protected string
The cache configuration name to use for route collection caching, null to disable caching
Trigger the application's routes() hook if the application exists and Router isn't initialized. Uses the routes cache if enabled via configuration param "Router.cache"
__construct( Cake\Http\BaseApplication $app null , string|null $cacheConfig null )
Constructor
Cake\Http\BaseApplication
$app
optional null $cacheConfig
optional null __invoke( Psr\Http\Message\ServerRequestInterface $request , Psr\Http\Message\ResponseInterface $response , callable $next )
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.
$request
$response
$next
buildRouteCollection( )
Check if route cache is enabled and use the configured Cache to 'remember' the route collection
loadRoutes( )
Trigger the application's routes() hook if the application exists and Router isn't initialized. Uses the routes cache if enabled via configuration param "Router.cache"
If the middleware is created without an Application, routes will be loaded via the automatic route loading that pre-dates the routes() hook.
prepareRouteCollection( )
Generate the route collection using the builder
protected Cake\Http\BaseApplication
The application that will have its routing hook invoked.
protected string
The cache configuration name to use for route collection caching, null to disable caching
© 2005–2018 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/3.6/class-Cake.Routing.Middleware.RoutingMiddleware.html