Dispatcher
class Dispatcher
Route dispatcher.
Traits
Constants
MIDDLEWARE_DEFAULT_PRIORITY |
Default middleware priority. |
Properties
protected Request | $request | Request. | |
protected Response | $response | Response. | |
protected Container | $container | Container. | |
protected array | $middleware | Route middleware. | |
protected array | $globalMiddleware | Global middleware. | |
protected array | $middlewarePriority | Middleware priority. |
Methods
Splits function name and parameters into an array.
Parses custom "function calls".
Sets the middleware priority.
Resets middleware priority.
Registers middleware.
Sets the chosen middleware as global.
Resolves the middleware.
Orders resolved middleware by priority.
Executes a controller action.
Details
in FunctionParserTrait at line 29
protected array
splitFunctionAndParameters(string $function)
Splits function name and parameters into an array.
in FunctionParserTrait at line 48
protected array
parseFunction(string $function, bool|null $namedParameters = null)
Parses custom "function calls".
The return value is an array consisting of the function name and parameters.
at line 93
__construct(Request $request, Response $response, Container|null $container = null)
Constructor.
at line 108
Dispatcher
setMiddlewarePriority(array $priority)
Sets the middleware priority.
at line 120
Dispatcher
resetMiddlewarePriority()
Resets middleware priority.
at line 135
Dispatcher
registerMiddleware(string $name, string $middleware, int|null $priority = null)
Registers middleware.
at line 153
Dispatcher
setMiddlewareAsGlobal(array $middleware)
Sets the chosen middleware as global.
at line 166
protected array
resolveMiddleware(string $middleware)
Resolves the middleware.
at line 184
protected array
orderMiddlewareByPriority(array $middleware)
Orders resolved middleware by priority.
at line 223
protected
addMiddlewareToStack(Onion $onion, array $middleware)
Adds route middleware to the stack.
at line 257
protected Response
executeClosure(Closure $closure, array $parameters)
Executes a closure action.
at line 269
protected Response
executeController(string $controller, array $parameters)
Executes a controller action.