\Cake\RoutingDispatcherFactory

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

Summary

Methods
Properties
Constants
add()
create()
filters()
clear()
No public properties found
No constants found
_createFilter()
$_stack
N/A
No private methods found
No private properties found
N/A

Properties

$_stack

$_stack : array<mixed,\Cake\Routing\DispatcherFilter>

Stack of middleware to apply to dispatchers.

Type

array<mixed,\Cake\Routing\DispatcherFilter>

Methods

add()

add(string|\Cake\Routing\DispatcherFilter  $filter, array  $options = array()) : \Cake\Routing\DispatcherFilter

Add a new middleware object to the stack of middleware that will be executed.

Instances of filters will be re-used across all sub-requests in a request.

Parameters

string|\Cake\Routing\DispatcherFilter $filter

Either the classname of the filter or an instance to use.

array $options

Constructor arguments/options for the filter if you are using a string name. If you are passing an instance, this argument will be ignored.

Returns

\Cake\Routing\DispatcherFilter

create()

create() : \Cake\Routing\Dispatcher

Create a dispatcher that has all the configured middleware applied.

Returns

\Cake\Routing\Dispatcher

filters()

filters() : array<mixed,\Cake\Routing\DispatcherFilter>

Get the connected dispatcher filters.

Returns

array<mixed,\Cake\Routing\DispatcherFilter>

clear()

clear() : void

Clear the middleware stack.

_createFilter()

_createFilter(string  $name, array  $options) : \Cake\Routing\DispatcherFilter

Create an instance of a filter.

Parameters

string $name

The name of the filter to build.

array $options

Constructor arguments/options for the filter.

Throws

\Cake\Routing\Exception\MissingDispatcherFilterException

When filters cannot be found.

Returns

\Cake\Routing\DispatcherFilter