Responsibility: configurable protected properties with getters and setters, internal protected properties and internal methods used in most extended router implementations bellow.
Trait for classes:
- \MvcCore\Ext\Routers\Media
- \MvcCore\Ext\Routers\Localization
- \MvcCore\Ext\Routers\MediaAndLocalization
Methods summary
public
boolean
|
#
GetRouteGetRequestsOnly( )
Get TRUE to route site version only for GET requests.
FALSE to process advanced routing on all requests.
Get TRUE to route site version only for GET requests.
FALSE to process advanced routing on all requests.
Returns
boolean
|
public
MvcCore\Router |MvcCore\Ext\Routers\Extended
|
#
SetRouteGetRequestsOnly( boolean $routeGetRequestsOnly = TRUE )
Set TRUE to route site version only for GET requests.
FALSE to process advanced routing on all requests.
Set TRUE to route site version only for GET requests.
FALSE to process advanced routing on all requests.
Parameters
Returns
|
public
boolean
|
#
GetStricModeBySession( )
Get TRUE (default is FALSE ) to prevent user to be able to switch site version
only by requesting different url with different site version prefix. If he does it
and this configuration is TRUE , he is redirected back to his remembered site
version by session.
But if you really want to switch site version for your users, you need to add into
url special param to switch the version. But if you are creating url in controller
or in template, it's added automatically, when you put into second argument $params
key with different site version:
$this->Url('self', ['media_version' => 'mobile', 'lang' => 'de']); .
Get TRUE (default is FALSE ) to prevent user to be able to switch site version
only by requesting different url with different site version prefix. If he does it
and this configuration is TRUE , he is redirected back to his remembered site
version by session.
But if you really want to switch site version for your users, you need to add into
url special param to switch the version. But if you are creating url in controller
or in template, it's added automatically, when you put into second argument $params
key with different site version:
$this->Url('self', ['media_version' => 'mobile', 'lang' => 'de']); .
Returns
boolean
|
public
MvcCore\Router |MvcCore\Ext\Routers\Extended
|
#
SetStricModeBySession( boolean $stricModeBySession = TRUE )
Set TRUE (default is FALSE ) to prevent user to be able to switch site version
only by requesting different url with different site version prefix. If he does it
and this configuration is TRUE , he is redirected back to his remembered site
version by session.
But if you really want to switch site version for your users, you need to add into
url special param to switch the version. But if you are creating url in controller
or in template, it's added automatically, when you put into second argument $params
key with different site version:
$this->Url('self', ['media_version' => 'mobile', 'lang' => 'de']); .
Set TRUE (default is FALSE ) to prevent user to be able to switch site version
only by requesting different url with different site version prefix. If he does it
and this configuration is TRUE , he is redirected back to his remembered site
version by session.
But if you really want to switch site version for your users, you need to add into
url special param to switch the version. But if you are creating url in controller
or in template, it's added automatically, when you put into second argument $params
key with different site version:
$this->Url('self', ['media_version' => 'mobile', 'lang' => 'de']); .
Parameters
Returns
|
public
integer
|
#
GetSessionExpirationSeconds( )
Get session expiration in seconds to remember previously detected site version by user
agent or headers from previous requests. To not recognize site version by user agent
or headers every time, because it's time consuming. Default value is 0 - "until the
browser is closed". Session record is always used to compare, if user is requesting the
same or different site version. If request by url is into the same site version,
session record expiration is enlarged by this value. If request by url is into
current session place, session different site version, then new different
site version is stored in expiration is enlarged by this value and user is
redirected to different place. But if router is configured into session strict mode,
than to redirect user into new site version, there is necessary to add special
url switch param (always automatically added by Url() method). Because without it,
user is redirected strictly back into the same version.
Get session expiration in seconds to remember previously detected site version by user
agent or headers from previous requests. To not recognize site version by user agent
or headers every time, because it's time consuming. Default value is 0 - "until the
browser is closed". Session record is always used to compare, if user is requesting the
same or different site version. If request by url is into the same site version,
session record expiration is enlarged by this value. If request by url is into
current session place, session different site version, then new different
site version is stored in expiration is enlarged by this value and user is
redirected to different place. But if router is configured into session strict mode,
than to redirect user into new site version, there is necessary to add special
url switch param (always automatically added by Url() method). Because without it,
user is redirected strictly back into the same version.
Returns
integer
|
public
MvcCore\Router |MvcCore\Ext\Routers\Extended
|
#
SetSessionExpirationSeconds( integer $sessionExpirationSeconds = 0 )
Set session expiration in seconds to remember previously detected site version by user
agent or headers from previous requests. To not recognize site version by user agent
or headers every time, because it's time consuming. Default value is 0 - "until the
browser is closed". Session record is always used to compare, if user is requesting the
same or different site version. If request by url is into the same site version,
session record expiration is enlarged by this value. If request by url is into
current session place, session different site version, then new different
site version is stored in expiration is enlarged by this value and user is
redirected to different place. But if router is configured into session strict mode,
than to redirect user into new site version, there is necessary to add special
url switch param (always automatically added by Url() method). Because without it,
user is redirected strictly back into the same version.
Set session expiration in seconds to remember previously detected site version by user
agent or headers from previous requests. To not recognize site version by user agent
or headers every time, because it's time consuming. Default value is 0 - "until the
browser is closed". Session record is always used to compare, if user is requesting the
same or different site version. If request by url is into the same site version,
session record expiration is enlarged by this value. If request by url is into
current session place, session different site version, then new different
site version is stored in expiration is enlarged by this value and user is
redirected to different place. But if router is configured into session strict mode,
than to redirect user into new site version, there is necessary to add special
url switch param (always automatically added by Url() method). Because without it,
user is redirected strictly back into the same version.
Parameters
- $sessionExpirationSeconds
Returns
|
Properties summary
protected
boolean
|
$stricModeBySession
TRUE (default is FALSE ) to prevent user to be able to switch site version
only by requesting different url with different site version prefix. If he does it
and this configuration is TRUE , he is redirected back to his remembered site
version by session.
But if you really want to switch site version for your users, you need to add into
url special param to switch the version. But if you are creating url in controller
or in template, it's added automatically, when you put into second argument $params
key with different site version:
$this->Url('self', ['media_version' => 'mobile', 'lang' => 'de']); .
TRUE (default is FALSE ) to prevent user to be able to switch site version
only by requesting different url with different site version prefix. If he does it
and this configuration is TRUE , he is redirected back to his remembered site
version by session.
But if you really want to switch site version for your users, you need to add into
url special param to switch the version. But if you are creating url in controller
or in template, it's added automatically, when you put into second argument $params
key with different site version:
$this->Url('self', ['media_version' => 'mobile', 'lang' => 'de']); .
|
|
protected
integer
|
$sessionExpirationSeconds
Session expiration in seconds to remember previously detected site version by user
agent or headers from previous requests. To not recognize site version by user agent
or headers every time, because it's time consuming. Default value is 0 - "until the
browser is closed". Session record is always used to compare, if user is requesting the
same or different site version. If request by url is into the same site version,
session record expiration is enlarged by this value. If request by url is into
current session place, session different site version, then new different
site version is stored in expiration is enlarged by this value and user is
redirected to different place. But if router is configured into session strict mode,
than to redirect user into new site version, there is necessary to add special
url switch param (always automatically added by Url() method). Because without it,
user is redirected strictly back into the same version.
Session expiration in seconds to remember previously detected site version by user
agent or headers from previous requests. To not recognize site version by user agent
or headers every time, because it's time consuming. Default value is 0 - "until the
browser is closed". Session record is always used to compare, if user is requesting the
same or different site version. If request by url is into the same site version,
session record expiration is enlarged by this value. If request by url is into
current session place, session different site version, then new different
site version is stored in expiration is enlarged by this value and user is
redirected to different place. But if router is configured into session strict mode,
than to redirect user into new site version, there is necessary to add special
url switch param (always automatically added by Url() method). Because without it,
user is redirected strictly back into the same version.
|
|
protected static
string
|
$baseAuthClass
Base authentication module class name. \MvcCore\Ext\Auth by default.
This class name is used internally to try to get user instance to recognize
admin requests: \MvcCore\Ext\Auth::GetInstance()->GetUser(); .
Base authentication module class name. \MvcCore\Ext\Auth by default.
This class name is used internally to try to get user instance to recognize
admin requests: \MvcCore\Ext\Auth::GetInstance()->GetUser(); .
|
|
protected static
string
|
$adminRequestQueryParamName
Administration request query string param name to recognize administration
requests if this param exists in global $_GET array. admin by default.
Administration request query string param name to recognize administration
requests if this param exists in global $_GET array. admin by default.
|
|
protected
boolean
|
$adminRequest
Boolean flag if request is in administration or not. FALSE by default.
Boolean flag if request is in administration or not. FALSE by default.
|
|
protected
boolean
|
$routeGetRequestsOnly
TRUE to route media site version or to route localization only for GET
requests. FALSE to process advanced routing on all requests.
TRUE to route media site version or to route localization only for GET
requests. FALSE to process advanced routing on all requests.
|
|
protected
boolean|null
|
$isGet
TRUE if request is GET, FALSE otherwise.
TRUE if request is GET, FALSE otherwise.
|
|
protected
array
|
$requestGlobalGet
Reference to global $_GET array from request object.
Reference to global $_GET array from request object.
|
|
protected
MvcCore\Session |null
|
$session
Session namespace to store previously recognized site version by user agent
or by http headers to not do this every time, because it's time consuming.
Session namespace to store previously recognized site version by user agent
or by http headers to not do this every time, because it's time consuming.
|
|
protected
integer
|
$redirectStatusCode
Routing redirection status code, used in $this->redirectToVersion(); methods.
Routing redirection status code, used in $this->redirectToVersion(); methods.
|
|