PHP 클래스 Devise\Languages\LocaleDetector

파일 보기 프로젝트 열기: devisephp/cms

보호된 프로퍼티들

프로퍼티 타입 설명
$cookieKey string The cookie we store the locale under

공개 메소드들

메소드 설명
__construct ( Framework $Framework ) Construct a new LocaleDetector
cookie ( ) : string Get the locale from a cookie
current ( ) : string Get the current locale. At first we try to use the cookie if one is set. If a cookie is not set then we attempt to deduce the locale in this order: url segment, http headers, and finally we fall back to the universal locale which is set in laravel's app.locale (defaults to en).
header ( ) : string Get locale from header accept string
segment ( ) : string We don't use this, but we could use it later if we wanted to. It would get the locale from the first segment of the url, e.g.
universal ( ) : string Get the universal locale set by developer and laravel
update ( string $locale ) : string Updates the locale stored in this cookie

메소드 상세

__construct() 공개 메소드

Construct a new LocaleDetector
public __construct ( Framework $Framework )
$Framework Devise\Support\Framework

current() 공개 메소드

Get the current locale. At first we try to use the cookie if one is set. If a cookie is not set then we attempt to deduce the locale in this order: url segment, http headers, and finally we fall back to the universal locale which is set in laravel's app.locale (defaults to en).
public current ( ) : string
리턴 string

header() 공개 메소드

Get locale from header accept string
public header ( ) : string
리턴 string

segment() 공개 메소드

http://somesite.com/en/cool/page
public segment ( ) : string
리턴 string

universal() 공개 메소드

Get the universal locale set by developer and laravel
public universal ( ) : string
리턴 string

update() 공개 메소드

Updates the locale stored in this cookie
public update ( string $locale ) : string
$locale string
리턴 string

프로퍼티 상세

$cookieKey 보호되어 있는 프로퍼티

The cookie we store the locale under
protected string $cookieKey
리턴 string