Trait PropsGettersSetters
Methods summary
public
string|null
|
#
GetMediaSiteVersion( )
Get resolved media site version, used in \MvcCore\Request
object and possible to use in controller or view.
Possible values are always: "full" | "tablet" | "mobile" | NULL .
Get resolved media site version, used in \MvcCore\Request
object and possible to use in controller or view.
Possible values are always: "full" | "tablet" | "mobile" | NULL .
Returns
string|null
|
public
MvcCore\Ext\Routers\Media
|
#
SetMediaSiteVersion( string|null $mediaSiteVersion )
Set media site version, used in \MvcCore\Request
object and possible to use in controller or view.
Possible values are always: "full" | "tablet" | "mobile" | NULL .
Set media site version, used in \MvcCore\Request
object and possible to use in controller or view.
Possible values are always: "full" | "tablet" | "mobile" | NULL .
Parameters
Returns
|
public
array
&
|
#
GetAllowedMediaVersionsAndUrlValues( )
Get URL prefixes prepended before request URL path to describe media site
version in url. Keys are media site version values and values in array are
URL prefixes, how to describe media site version in URL. Full version with
possible empty string prefix is necessary to have as last item. If you do
not want to use rewrite routes, just have under your allowed keys any values.
Example:
[
'mobile' => 'm', // to have `/m` substring in every mobile URL begin.
'full' => '', // to have nothing extra in URL for full site version.
];
Get URL prefixes prepended before request URL path to describe media site
version in url. Keys are media site version values and values in array are
URL prefixes, how to describe media site version in URL. Full version with
possible empty string prefix is necessary to have as last item. If you do
not want to use rewrite routes, just have under your allowed keys any values.
Example:
[ 'mobile' => 'm', // to have `/m` substring in every mobile URL begin. 'full' => '', // to have nothing extra in URL for full site version.
];
Returns
array
|
public
MvcCore\Ext\Routers\Media
|
#
SetAllowedMediaVersionsAndUrlValues( array $allowedMediaVersionsAndUrlValues = [] )
Set URL prefixes prepended before request URL path to describe media site
version in URL. Keys are media site version values and values in array are
URL prefixes, how to describe media site version in URL. Full version with
possible empty string prefix is necessary to put as last item. If you do
not want to use rewrite routes, just put under your allowed keys any values.
Example:
\MvcCore\Ext\Routers\Media::GetInstance()->SetAllowedMediaVersionsAndUrlValues([
'mobile' => 'm', // to have `/m` substring in every mobile URL begin.
'full' => '', // to have nothing extra in URL for full site version.
]);
Set URL prefixes prepended before request URL path to describe media site
version in URL. Keys are media site version values and values in array are
URL prefixes, how to describe media site version in URL. Full version with
possible empty string prefix is necessary to put as last item. If you do
not want to use rewrite routes, just put under your allowed keys any values.
Example:
\MvcCore\Ext\Routers\Media::GetInstance()->SetAllowedMediaVersionsAndUrlValues([ 'mobile' => 'm', // to have `/m` substring in every mobile URL begin. 'full' => '', // to have nothing extra in URL for full site version.
]);
Parameters
- $allowedMediaVersionsAndUrlValues
Returns
|
protected
string|null
|
#
redirectMediaGetUrlValueAndUnsetGet( string $targetMediaSiteVersion )
Return media site version string value for redirection URL but if media
site version is defined by GET query string param, return NULL and set
target media site version string into GET params to complete query
string params into redirect URL later. But if the target media site version
string is the same as full media site version (default value), unset this
param from GET params array and return NULL in query string media
site version definition case.
Return media site version string value for redirection URL but if media
site version is defined by GET query string param, return NULL and set
target media site version string into GET params to complete query
string params into redirect URL later. But if the target media site version
string is the same as full media site version (default value), unset this
param from GET params array and return NULL in query string media
site version definition case.
Parameters
- $targetMediaSiteVersion
- Media site version string.
Returns
string|null
|
Properties summary
protected
array
|
$allowedMediaVersionsAndUrlValues
Url prefixes prepended before request URL path to describe media site version in url.
Keys are media site version values and values in array are URL prefixes, how
to describe media site version in url.
Full version with possible empty string prefix is necessary to put as last item.
If you do not want to use rewrite routes, just put under your allowed keys any values.
Url prefixes prepended before request URL path to describe media site version in url.
Keys are media site version values and values in array are URL prefixes, how
to describe media site version in url.
Full version with possible empty string prefix is necessary to put as last item.
If you do not want to use rewrite routes, just put under your allowed keys any values.
|
#
[
Routers\IMedia::MEDIA_VERSION_MOBILE => 'm',
Routers\IMedia::MEDIA_VERSION_TABLET => 't',
Routers\IMedia::MEDIA_VERSION_FULL => '',
]
|
protected
string|null
|
$switchUriParamMediaSiteVersion
Media site version to switch user into.
Default value is NULL . If there is any media site version
under key media_version in $_GET array, this property
has string with this value.
Media site version to switch user into.
Default value is NULL . If there is any media site version
under key media_version in $_GET array, this property
has string with this value.
|
|
protected
string|null
|
$mediaSiteVersion
Resolved media site version, used in \MvcCore\Request
object and possible to use in controller or view.
Possible values are always: "full" | "tablet" | "mobile" | NULL .
Resolved media site version, used in \MvcCore\Request
object and possible to use in controller or view.
Possible values are always: "full" | "tablet" | "mobile" | NULL .
|
|
protected
string|null
|
$sessionMediaSiteVersion
Media site version founded in session.
Media site version founded in session.
|
|
protected
string|null
|
$requestMediaSiteVersion
Requested media site version.
Requested media site version.
|
|
protected
boolean|null
|
$firstRequestMediaDetection
If NULL , request was not first, there was something in session stored by
previous requests.
If TRUE , request was first, nothing was in session from previous requests
and detected version is the same as requested media site version.
If NULL , request was not first, there was something in session stored by
previous requests.
If TRUE , request was first, nothing was in session from previous requests
and detected version is the same as requested media site version.
If FALSE , request was first, nothing was in session from previous requests
and detected version is different from requested media site version.
There is necessary to redirect user to detected version from first request.
|
|