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.3 Red Velvet API

  • Project:
    • CakePHP
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 3.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
    • Http
      • Client
    • I18n
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • Shell
    • TestSuite
    • Utility
    • Validation
    • View

Class ActionDispatcher

This class provides compatibility with dispatcher filters and interacting with the controller layers.

Long term this should just be the controller dispatcher, but for now it will do a bit more than that.

Namespace: Cake\Http

Property Summary

  • $_eventClass protected
    string

    Default class name for new event objects.

  • $_eventManager protected
    Cake\Event\EventManager

    Instance of the Cake\Event\EventManager this object is using to dispatch inner events.

  • $factory protected
    Cake\Http\ControllerFactory

    Controller factory instance.

  • $filters protected
    array

    Attached routing filters

Method Summary

  • __construct() public

    Constructor

  • _invoke() protected

    Invoke a controller's action and wrapping methods.

  • addFilter() public deprecated

    Add a filter to this dispatcher.

  • dispatch() public

    Dispatches a Request & Response

  • dispatchEvent() public

    Wrapper for creating and dispatching events.

  • eventManager() public

    Returns the Cake\Event\EventManager manager instance for this object.

  • getFilters() public

    Get the connected filters.

Method Detail

__construct() ¶ public

__construct(Cake\Http\ControllerFactory|null $factory = null, Cake\Event\EventManager|null $eventManager = null, array $filters = [])

Constructor

Parameters
Cake\Http\ControllerFactory|null $factory optional

A controller factory instance.

Cake\Event\EventManager|null $eventManager optional

An event manager if you want to inject one.

array $filters optional

The list of filters to include.

_invoke() ¶ protected

_invoke(Cake\Controller\Controller $controller): Cake\Network\Response

Invoke a controller's action and wrapping methods.

Parameters
Cake\Controller\Controller $controller

The controller to invoke.

Returns
Cake\Network\Response
Throws
LogicException
If the controller action returns a non-response value.

addFilter() ¶ public

addFilter(Cake\Event\EventListenerInterface $filter): void

Add a filter to this dispatcher.

The added filter will be attached to the event manager used by this dispatcher.

Parameters
Cake\Event\EventListenerInterface $filter

The filter to connect. Can be any EventListenerInterface. Typically an instance of \Cake\Routing\DispatcherFilter.

Returns
void

dispatch() ¶ public

dispatch(Cake\Network\Request $request, Cake\Network\Response $response): Cake\Network\Response

Dispatches a Request & Response

Parameters
Cake\Network\Request $request

The request to dispatch.

Cake\Network\Response $response

The response to dispatch.

Returns
Cake\Network\Response

dispatchEvent() ¶ public

dispatchEvent(string $name, array|null $data = null, object|null $subject = null): Cake\Event\Event

Wrapper for creating and dispatching events.

Returns a dispatched event.

Parameters
string $name

Name of the event.

array|null $data optional

Any value you wish to be transported with this event to it can be read by listeners.

object|null $subject optional

The object that this event applies to ($this by default).

Returns
Cake\Event\Event

eventManager() ¶ public

eventManager(Cake\Event\EventManager|null $eventManager = null): Cake\Event\EventManager

Returns the Cake\Event\EventManager manager instance for this object.

You can use this instance to register any new listeners or callbacks to the object events, or create your own events and trigger them at will.

Parameters
Cake\Event\EventManager|null $eventManager optional

the eventManager to set

Returns
Cake\Event\EventManager

getFilters() ¶ public

getFilters(): array

Get the connected filters.

Returns
array

Property Detail

$_eventClass ¶ protected

Default class name for new event objects.

Type
string

$_eventManager ¶ protected

Instance of the Cake\Event\EventManager this object is using to dispatch inner events.

Type
Cake\Event\EventManager

$factory ¶ protected

Controller factory instance.

Type
Cake\Http\ControllerFactory

$filters ¶ protected

Attached routing filters

Type
array
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