Fr3nch13/CakePHP Utilities

RoutingMiddleware
in package
implements MiddlewareInterface

Applies routing rules to the request and creates the controller instance if possible.

Table of Contents

Interfaces

MiddlewareInterface
Participant in processing a server request and response.

Constants

ROUTE_COLLECTION_CACHE_KEY  = 'routeCollection'
Key used to store the route collection in the cache engine

Properties

$app  : RoutingApplicationInterface
The application that will have its routing hook invoked.
$cacheConfig  : string|null
The cache configuration name to use for route collection caching, null to disable caching

Methods

__construct()  : mixed
Constructor
process()  : ResponseInterface
Apply routing and update the request.
buildRouteCollection()  : RouteCollection
Check if route cache is enabled and use the configured Cache to 'remember' the route collection
loadRoutes()  : void
Trigger the application's routes() hook if the application exists and Router isn't initialized.
prepareRouteCollection()  : RouteCollection
Generate the route collection using the builder

Constants

ROUTE_COLLECTION_CACHE_KEY

Key used to store the route collection in the cache engine

public string ROUTE_COLLECTION_CACHE_KEY = 'routeCollection'

Properties

$cacheConfig

The cache configuration name to use for route collection caching, null to disable caching

protected string|null $cacheConfig

Methods

buildRouteCollection()

Check if route cache is enabled and use the configured Cache to 'remember' the route collection

protected buildRouteCollection() : RouteCollection
Return values
RouteCollection

loadRoutes()

Trigger the application's routes() hook if the application exists and Router isn't initialized.

protected loadRoutes() : void

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 prepareRouteCollection() : RouteCollection
Return values
RouteCollection

        
On this page

Search results