FastRouteMiddleware implements MiddlewareInterface Uses HasResponseFactory
Routing Middleware that uses nikic/fastroute Based on Middlewares\FastRoute with the addition of routes definition processing and additionl route parameters outside of route patterns
Tags
Interfaces, Classes and Traits
- MiddlewareInterface
Table of Contents
- $attribute : string
- $router : Dispatcher
- __construct() : mixed
- Set the Dispatcher instance and optionally the response factory to return the error responses.
- process() : ResponseInterface
- Process a server request and return a response.
- setHandler() : ServerRequestInterface
- Set the handler reference on the request.
Properties
$attribute
private
string
$attribute
= 'request-handler'
$router
private
Dispatcher
$router
Methods
__construct()
Set the Dispatcher instance and optionally the response factory to return the error responses.
public
__construct(string $environment, array<string|int, mixed> $routes[, string $tmpFolderPath = null ][, ResponseFactoryInterface $responseFactory = null ]) : mixed
Parameters
- $environment : string
- $routes : array<string|int, mixed>
- $tmpFolderPath : string = null
- $responseFactory : ResponseFactoryInterface = null
Return values
mixed —process()
Process a server request and return a response.
public
process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
Parameters
- $request : ServerRequestInterface
- $handler : RequestHandlerInterface
Return values
ResponseInterface —setHandler()
Set the handler reference on the request.
protected
setHandler(ServerRequestInterface $request, mixed $handler) : ServerRequestInterface
Parameters
- $request : ServerRequestInterface
- $handler : mixed