LazyLoadingMiddleware

Implements \Psr\Http\Server\MiddlewareInterface

Class LazyLoadingMiddleware

This class stores given middleware inside a Container factory in order to load them only when needed.

package

LightMVC/ASCMVC

Methods

LazyLoadingMiddleware constructor.

__construct(\Pimple\Container $container, string $middlewareName) 

Arguments

$container

\Pimple\Container

$middlewareName

string

Middleware interface method.

process(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Server\RequestHandlerInterface $handler) : \Psr\Http\Message\ResponseInterface

Arguments

$request

\Psr\Http\Message\ServerRequestInterface

$handler

\Psr\Http\Server\RequestHandlerInterface

Response

\Psr\Http\Message\ResponseInterface

Properties

Contains an instance of Pimple\Container.

container : \Pimple\Container
var

Type(s)

\Pimple\Container

Contains a string which is the name of the middleware.

middlewareName : string
var

Type(s)

string