Class MiddlewareFactory
Marshal middleware for use in the application.
This class provides a number of methods for preparing and returning middleware for use within an application.
If any middleware provided is already a MiddlewareInterface, it can be used verbatim or decorated as-is. Other middleware types acceptable are:
Additionally, the class provides the following decorator/utility methods:
package |
LightMVC/ASCMVC |
---|
__construct(\Pimple\Container $container)
\Pimple\Container
callableMiddleware(callable $middleware) : \Laminas\Stratigility\Middleware\CallableMiddlewareDecorator
callable
\Laminas\Stratigility\Middleware\CallableMiddlewareDecorator
handlerMiddleware(\Psr\Http\Server\RequestHandlerInterface $handler) : \Laminas\Stratigility\Middleware\RequestHandlerMiddleware
\Psr\Http\Server\RequestHandlerInterface
\Laminas\Stratigility\Middleware\RequestHandlerMiddleware
lazyMiddleware(string $middleware) : \Ascmvc\Middleware\LazyLoadingMiddleware
pipeline(string|array|\Laminas\Stratigility\MiddlewarePipe $middleware) : \Laminas\Stratigility\MiddlewarePipe
This method allows passing an array of middleware as either:
Each item is passed to prepare() before being passed to the MiddlewarePipe instance the method returns.
Throws |
|
---|
string|array|\Laminas\Stratigility\MiddlewarePipe
\Laminas\Stratigility\MiddlewarePipe
prepare(string|array|callable|\Psr\Http\Server\MiddlewareInterface|\Psr\Http\Server\RequestHandlerInterface $middleware) : \Psr\Http\Server\MiddlewareInterface
Throws |
|
---|
string|array|callable|\Psr\Http\Server\MiddlewareInterface|\Psr\Http\Server\RequestHandlerInterface
\Psr\Http\Server\MiddlewareInterface
container : \Pimple\Container
var |
---|
\Pimple\Container