PHP Класс Contao\CoreBundle\EventListener\LocaleListener

Наследование: use trait Contao\CoreBundle\Framework\ScopeAwareTrait
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( array $availableLocales ) Constructor.
createWithLocales ( string $defaultLocale, string $rootDir ) : static Creates a new instance with the installed languages.
onKernelRequest ( GetResponseEvent $event ) Sets the default locale based on the request or session.

Приватные методы

Метод Описание
formatLocaleId ( string $locale ) : string Formats a string to represent a locale ID.
getLocale ( Request $request ) : string Returns the locale from the request, the session or the HTTP header.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( array $availableLocales )
$availableLocales array

createWithLocales() публичный статический Метод

Creates a new instance with the installed languages.
public static createWithLocales ( string $defaultLocale, string $rootDir ) : static
$defaultLocale string
$rootDir string
Результат static

onKernelRequest() публичный Метод

Sets the default locale based on the request or session.
public onKernelRequest ( GetResponseEvent $event )
$event Symfony\Component\HttpKernel\Event\GetResponseEvent