Method | Description | |
---|---|---|
__construct ( string | null $basePath = null ) | Constructor. Set the path prefix. | |
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface | Execute the middleware. | |
autodetect ( boolean $autodetect = true ) : self | Autodetect the basePath. | |
getBasePath ( Psr\Http\Message\ServerRequestInterface $request ) : string | null | Returns the basePath. | |
getGenerator ( Psr\Http\Message\ServerRequestInterface $request ) : callable | null | Returns a callable to build a full path. |
Method | Description | |
---|---|---|
detectBasePath ( Psr\Http\Message\ServerRequestInterface $request ) : string | Auto-detect the base path from the request environment. |
public __construct ( string | null $basePath = null ) | ||
$basePath | string | null |
public __invoke ( 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 |
public autodetect ( boolean $autodetect = true ) : self | ||
$autodetect | boolean | |
return | self |
public static getBasePath ( Psr\Http\Message\ServerRequestInterface $request ) : string | null | ||
$request | Psr\Http\Message\ServerRequestInterface | |
return | string | null |
public static getGenerator ( Psr\Http\Message\ServerRequestInterface $request ) : callable | null | ||
$request | Psr\Http\Message\ServerRequestInterface | |
return | callable | null |