Uses the router to route the incoming request, injecting the request
with:
- the route result object (under a key named for the RouteResult class)
- attributes for each matched routing parameter
On completion, it calls on the next middleware (typically the
dispatchMiddleware()).
If routing fails, $next() is called; if routing fails due to HTTP
method negotiation, the response is set to a 405, injected with an
Allow header, and $next() is called with its $error argument set
to the value 405 (invoking the next error middleware).
public routeMiddleware ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface | ||
$request | Psr\Http\Message\ServerRequestInterface | |
$response | Psr\Http\Message\ResponseInterface | |
$next | callable | |
return | Psr\Http\Message\ResponseInterface |