DoDomuDojade Documentation

LocaleMiddleware
in package
implements MiddlewareInterface

Read onlyYes
FinalYes

Table of Contents

Interfaces

MiddlewareInterface

Constants

ALLOWED_LOCALES  = ['en', 'pl']
DEFAULT_LOCALE  = 'en'

Properties

$context  : LocaleContext

Methods

__construct()  : mixed
handle()  : ResponseInterface
detectLocale()  : string
getSessionLocale()  : string|null
parseAcceptLanguageHeader()  : string|null
validate()  : string|null

Constants

Properties

Methods

handle()

public handle(ServerRequestInterface $request, callable $next) : ResponseInterface
Parameters
$request : ServerRequestInterface
$next : callable
Return values
ResponseInterface

getSessionLocale()

private getSessionLocale() : string|null
Return values
string|null

parseAcceptLanguageHeader()

private parseAcceptLanguageHeader() : string|null
Return values
string|null

validate()

private validate(string $locale) : string|null
Parameters
$locale : string
Return values
string|null

        
On this page

Search results