Zend Framework
3.0
|
Iterate a queue of middlewares and execute them. More...
Public Member Functions | |
__construct (SplQueue $queue, callable $done) | |
Constructor. | |
__invoke (ServerRequestInterface $request, ResponseInterface $response, $err=null) | |
Call the next Route in the queue. | |
Iterate a queue of middlewares and execute them.
__construct | ( | SplQueue | $queue, |
callable | $done | ||
) |
Constructor.
Clones the queue provided to allow re-use.
SplQueue | $queue | |
callable | $done |
__invoke | ( | ServerRequestInterface | $request, |
ResponseInterface | $response, | ||
$err = null |
|||
) |
Call the next Route in the queue.
Next requires that a request and response are provided; these will be passed to any middleware invoked, including the $done callable, if invoked.
If the $err value is not null, the invocation is considered to be an error invocation, and Next will search for the next error middleware to dispatch, passing it $err along with the request and response.
Once dispatch is complete, if the result is a response instance, that value will be returned; otherwise, the currently registered response instance will be returned.
ServerRequestInterface | $request | |
ResponseInterface | $response | |
null | mixed | $err |