Trait PreRouting
Methods summary
protected
boolean
|
#
preRouteLocalization( )
Detect localization by configured rules, set up detected localization to
current context, into request and into session and redirect if necessary.
Return always TRUE and return FALSE if request is redirected.
This function is always called before routing.
Detect localization by configured rules, set up detected localization to
current context, into request and into session and redirect if necessary.
Return always TRUE and return FALSE if request is redirected.
This function is always called before routing.
Returns
boolean
|
protected
boolean
|
#
manageLocalizationSwitchingAndRedirect( )
Store new localization from url in session namespace, remove localization
switching param from request object global collection $_GET and
redirect to the same page without switching param.
Store new localization from url in session namespace, remove localization
switching param from request object global collection $_GET and
redirect to the same page without switching param.
Returns
boolean
|
protected
|
#
manageLocalizationDetectionAndStoreInSession( )
Detect language and locale by sent Accept-Language http header string
and store detected result in session namespace for next requests.
Also store boolean property $this->firstRequestLocalizationDetection if there was
matched the very first accepted language and locale or not.
Detect language and locale by sent Accept-Language http header string
and store detected result in session namespace for next requests.
Also store boolean property $this->firstRequestLocalizationDetection if there was
matched the very first accepted language and locale or not.
|
protected
boolean
|
#
checkLocalizationWithUrlAndRedirectIfNecessary( )
Check request localization, session localization and possible detected
localization in local context by Accept-Language http header, check
if there ware any detection in first request and than do everything by
configuration. This function is optimized to not process too much
conditions or to not process anything twice. It's still do the logic
very well. Do not change anything if you don't know all router options.
Check request localization, session localization and possible detected
localization in local context by Accept-Language http header, check
if there ware any detection in first request and than do everything by
configuration. This function is optimized to not process too much
conditions or to not process anything twice. It's still do the logic
very well. Do not change anything if you don't know all router options.
Returns
boolean
|
protected
array
|
#
setUpLocalizationToContextAndSession( string[] $targetLocalization )
Set up localization array into current context and into session and return it.
Set up localization array into current context and into session and return it.
Parameters
Returns
array
|