PHP Class Contao\CoreBundle\EventListener\LocaleListener

Inheritance: use trait Contao\CoreBundle\Framework\ScopeAwareTrait
Afficher le fichier Open project: contao/core-bundle Class Usage Examples

Méthodes publiques

Méthode Description
__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.

Private Methods

Méthode Description
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.

Method Details

__construct() public méthode

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

createWithLocales() public static méthode

Creates a new instance with the installed languages.
public static createWithLocales ( string $defaultLocale, string $rootDir ) : static
$defaultLocale string
$rootDir string
Résultat static

onKernelRequest() public méthode

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