Class DispatcherFactory
A factory for creating dispatchers with all the desired middleware connected.
Property Summary
- 
        $_stack protected staticCake\Routing\DispatcherFilter[]Stack of middleware to apply to dispatchers. 
Method Summary
- 
          _createFilter() protected staticCreate an instance of a filter. 
- 
          add() public staticAdd a new middleware object to the stack of middleware that will be executed. 
- 
          clear() public staticClear the middleware stack. 
- 
          create() public staticCreate a dispatcher that has all the configured middleware applied. 
- 
          filters() public staticGet the connected dispatcher filters. 
Method Detail
_createFilter() ¶ protected static
_createFilter(string $name, array $options): Cake\Routing\DispatcherFilterCreate an instance of a filter.
Parameters
- 
                string$name
- The name of the filter to build. 
- 
                array$options
- Constructor arguments/options for the filter. 
Returns
Cake\Routing\DispatcherFilterThrows
Cake\Routing\Exception\MissingDispatcherFilterExceptionWhen filters cannot be found.
add() ¶ public static
add(string|Cake\Routing\DispatcherFilter $filter, array $options = []): Cake\Routing\DispatcherFilterAdd 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 optional
- 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\DispatcherFiltercreate() ¶ public static
create(): Cake\Routing\DispatcherCreate a dispatcher that has all the configured middleware applied.
Returns
Cake\Routing\Dispatcherfilters() ¶ public static
filters(): Cake\Routing\DispatcherFilter[]Get the connected dispatcher filters.
Returns
Cake\Routing\DispatcherFilter[]Property Detail
$_stack ¶ protected static
Stack of middleware to apply to dispatchers.
Type
Cake\Routing\DispatcherFilter[]