PHP 클래스 Contao\CoreBundle\EventListener\LocaleListener

상속: use trait Contao\CoreBundle\Framework\ScopeAwareTrait
파일 보기 프로젝트 열기: contao/core-bundle 1 사용 예제들

공개 메소드들

메소드 설명
__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