Method | Description | |
---|---|---|
__construct ( array $languages ) | Define de available languages. | |
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface | Execute the middleware. | |
getLanguage ( Psr\Http\Message\ServerRequestInterface $request ) : string | null | Returns the language. | |
usePath ( boolean $usePath = true ) : self | Use the base path to detect the current language. |
public __construct ( array $languages ) | ||
$languages | array |
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 static getLanguage ( Psr\Http\Message\ServerRequestInterface $request ) : string | null | ||
$request | Psr\Http\Message\ServerRequestInterface | |
return | string | null |