CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (Github)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 3.1 Red Velvet API

  • Project:
    • CakePHP
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 3.1
      • 6.0
      • 5.4
      • 5.3
      • 5.2
      • 5.1
      • 5.0
      • 4.6
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 3.9
      • 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

  • Global
  • Cake
    • Auth
    • Cache
    • Collection
    • Console
    • Controller
    • Core
    • Database
    • Datasource
    • Error
    • Event
    • Filesystem
    • Form
    • I18n
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • Shell
    • TestSuite
    • Utility
    • Validation
    • View

Namespace Routing

Namespaces

  • Cake\Routing\Exception
  • Cake\Routing\Filter
  • Cake\Routing\Route

Classes

  • Dispatcher

    Dispatcher converts Requests into controller actions. It uses the dispatched Request to locate and load the correct controller. If found, the requested action is called on the controller

  • DispatcherFactory

    A factory for creating dispatchers with all the desired middleware connected.

  • DispatcherFilter

    This abstract class represents a filter to be applied to a dispatcher cycle. It acts as an event listener with the ability to alter the request or response as needed before it is handled by a controller or after the response body has already been built.

    Subclasses of this class use a class naming convention having a Filter suffix.

    Limiting filters to specific paths

    By using the for option you can limit with request paths a filter is applied to. Both the before and after event will have the same conditions applied to them. For example, if you only wanted a filter applied to blog requests you could do:

    $filter = new BlogFilter(['for' => '/blog']);

    When the above filter is connected to a dispatcher it will only fire its beforeDispatch and afterDispatch methods on requests that start with /blog.

    The for condition can also be a regular expression by using the preg: prefix:

    $filter = new BlogFilter(['for' => 'preg:#^/blog/\d+$#']);

    Limiting filters based on conditions

    In addition to simple path based matching you can use a closure to match on arbitrary request or response conditions. For example:

    $cookieMonster = new CookieFilter([
      'when' => function ($req, $res) {
        // Custom code goes here.
      }
    ]);

    If your when condition returns true the before/after methods will be called.

    When using the for or when matchers, conditions will be re-checked on the before and after callback as the conditions could change during the dispatch cycle.

  • RouteBuilder

    Provides features for building routes inside scopes.

    Gives an easy to use way to build routes and append them into a route collection.

  • RouteCollection

    Contains a collection of routes.

    Provides an interface for adding/removing routes and parsing/generating URLs with the routes it contains.

  • Router

    Parses the request URL into controller, action, and parameters. Uses the connected routes to match the incoming URL string to parameters that will allow the request to be dispatched. Also handles converting parameter lists into URL strings, using the connected routes. Routing allows you to decouple the way the world interacts with your application (URLs) and the implementation (controllers and actions).

    Connecting routes

    Connecting routes is done using Router::connect(). When parsing incoming requests or reverse matching parameters, routes are enumerated in the order they were connected. For more information on routes and how to connect them see Router::connect().

Traits

  • RequestActionTrait

    Provides the requestAction() method for doing sub-requests

OpenHub
Pingping
Linode
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (Github)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs