Method | Description | |
---|---|---|
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface | Execute the middleware. | |
addFormat ( string $format, array $mimeTypes, array $extensions = null ) : self | Add a new format. | |
defaultFormat ( string $format ) : self | Set the default format. | |
getFormat ( Psr\Http\Message\ServerRequestInterface $request ) : string | null | Returns the format. |
Method | Description | |
---|---|---|
getFromExtension ( Psr\Http\Message\ServerRequestInterface $request ) : null | string | Returns the format using the file extension. | |
getFromHeader ( Psr\Http\Message\ServerRequestInterface $request ) : null | string | Returns the format using the Accept header. |
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 defaultFormat ( string $format ) : self | ||
$format | string | |
return | self |