CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Team
    • Issues (Github)
    • YouTube Channel
    • Get Involved
    • Bakery
    • Featured Resources
    • Newsletter
    • Certification
    • My CakePHP
    • CakeFest
    • Facebook
    • Twitter
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 3.8 Red Velvet API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 3.8
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Cake
    • Auth
      • Storage
    • Cache
      • Engine
    • Collection
      • Iterator
    • Command
    • Console
      • Exception
    • Controller
      • Component
      • Exception
    • Core
      • Configure
        • Engine
      • Exception
      • Retry
    • Database
      • Driver
      • Exception
      • Expression
      • Schema
      • Statement
      • Type
    • Datasource
      • Exception
    • Error
      • Middleware
    • Event
      • Decorator
    • Filesystem
    • Form
    • Http
      • Client
        • Adapter
        • Auth
      • Cookie
      • Exception
      • Middleware
      • Session
    • I18n
      • Formatter
      • Middleware
      • Parser
    • Log
      • Engine
    • Mailer
      • Exception
      • Transport
    • Network
      • Exception
    • ORM
      • Association
      • Behavior
        • Translate
      • Exception
      • Locator
      • Rule
    • Routing
      • Exception
      • Filter
      • Middleware
      • Route
    • Shell
      • Helper
      • Task
    • TestSuite
      • Fixture
      • Stub
    • Utility
      • Exception
    • Validation
    • View
      • Exception
      • Form
      • Helper
      • Widget
  • None

Classes

  • AssetMiddleware
  • RoutingMiddleware

Class RoutingMiddleware

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

Namespace: Cake\Routing\Middleware
Location: Routing/Middleware/RoutingMiddleware.php

Constants summary

  • string
    ROUTE_COLLECTION_CACHE_KEY ¶
    'routeCollection'

Properties summary

  • $app protected
    Cake\Core\HttpApplicationInterface|null
    The application that will have its routing hook invoked.
  • $cacheConfig protected
    string|null

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

Method Summary

  • __construct() public
    Constructor
  • __invoke() public
    Apply routing and update the request.
  • buildRouteCollection() protected
    Check if route cache is enabled and use the configured Cache to 'remember' the route collection
  • loadRoutes() protected

    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"

  • prepareRouteCollection() protected
    Generate the route collection using the builder

Method Detail

__construct() public ¶

__construct( Cake\Core\HttpApplicationInterface $app = null , string|null $cacheConfig = null )

Constructor

Parameters
Cake\Core\HttpApplicationInterface $app optional null
The application instance that routes are defined on.
string|null $cacheConfig optional null
The cache config name to use or null to disable routes cache

__invoke() public ¶

__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.

Parameters
Psr\Http\Message\ServerRequestInterface $request
The request.
Psr\Http\Message\ResponseInterface $response
The response.
callable $next
The next middleware to call.
Returns
Psr\Http\Message\ResponseInterface
A response.

buildRouteCollection() protected ¶

buildRouteCollection( )

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

Returns
Cake\Routing\RouteCollection

loadRoutes() protected ¶

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() protected ¶

prepareRouteCollection( )

Generate the route collection using the builder

Returns
Cake\Routing\RouteCollection

Properties detail

$app ¶

protected Cake\Core\HttpApplicationInterface|null

The application that will have its routing hook invoked.

$cacheConfig ¶

protected string|null

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

Follow @CakePHP
#IRC
OpenHub
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Logos & Trademarks
  • Community
  • Team
  • Issues (Github)
  • YouTube Channel
  • Get Involved
  • Bakery
  • Featured Resources
  • Newsletter
  • Certification
  • My CakePHP
  • CakeFest
  • Facebook
  • Twitter
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs