Methods summary
public
array
|
#
Filter( array & $params = [], array & $defaultParams = [], string $direction = \MvcCore\IRoute::CONFIG_FILTER_IN )
Parameters
- $params
- $defaultParams
- $direction
Returns
array Filtered params array.
Inheritdocs
|
public
string[]
|
#
Url( MvcCore\IRequest $request, array & $params = [], array & $defaultUrlParams = [], string $queryStringParamsSepatator = '&', boolean $splitUrl = FALSE )
Parameters
- $request
- Currently requested request object.
- $params
URL params from application point completed
by developer.
- $defaultUrlParams
Requested URL route params and query string
params without escaped HTML special chars:
< > & " ' & .
- $queryStringParamsSepatator
Query params separator, & by default. Always
automatically completed by router instance.
- $splitUrl
Boolean value about to split completed result URL
into two parts or not. Default is FALSE to return
a string array with only one record - the result
URL. If TRUE , result url is split into two
parts and function return array with two items.
Returns
string[] Result URL address in array. If last argument is
FALSE by default, this function returns only
single item array with result URL. If last
argument is TRUE , function returns result URL
in two parts - domain part with base path and
path part with query string.
Inheritdocs
|
protected
string
|
#
urlComposeByReverseSectionsAndParams( string & $reverse, stdClass[] & $reverseSections, array & $reverseParams, array & $params, array & $defaults )
Compose URL by reverse pattern value, by reverse (fixed or variable)
sections info, by reverse params info (start, end, length), by given
params array with final values and by default params values defined by
route object. Unset all applied params from given $params array to not
render them again in possible query string later.
Compose URL by reverse pattern value, by reverse (fixed or variable)
sections info, by reverse params info (start, end, length), by given
params array with final values and by default params values defined by
route object. Unset all applied params from given $params array to not
render them again in possible query string later.
Parameters
- $reverse
A route reverse string without brackets defining
URL variable sections.
- $reverseSections
Reverse sections info, where each item contains
data about if section is fixed or not, start,
length and end of section.
- $reverseParams
An array with keys as param names and values as
\stdClass objects with data about each reverse param.
- $params
An array with keys as param names and values as
param final values.
- $defaults
An array with keys as param names and values as
param default values defined in route object.
Returns
string
|
protected
string[]
|
#
urlAbsPartAndSplit( MvcCore\IRequest $request, string $resultUrl, array & $domainParams, boolean $splitUrl )
After final URL is completed, split result URL into two parts. First part
as scheme, domain part and base path and second part as application
request path and query string.
After final URL is completed, split result URL into two parts. First part
as scheme, domain part and base path and second part as application
request path and query string.
Parameters
- $request
- A request object.
- $resultUrl
Result URL to split. REsult URL still could
contain domain part or base path replacements.
- $domainParams
Array with params for first URL part (scheme,
domain, base path).
- $splitUrl
Boolean value about to split completed result URL
into two parts or not. Default is FALSE to return
a string array with only one record - the result
URL. If TRUE , result url is split into two
parts and function return array with two items.
Returns
string[] Result URL address in array. If last argument is
FALSE by default, this function returns only
single item array with result URL. If last
argument is TRUE , function returns result URL
in two parts - domain part with base path and
path part with query string.
|
protected
|
#
urlReplaceDomainReverseParams( MvcCore\IRequest $request, string & $resultUrl, array & $domainParams, mixed $domainParamsFlag )
Replace all domain params percentage replacements in finally completed
URL by given $domainParams array values. If there is founded any
percentage replacement which is not presented in $domainParams array,
there is used value from request object.
Replace all domain params percentage replacements in finally completed
URL by given $domainParams array values. If there is founded any
percentage replacement which is not presented in $domainParams array,
there is used value from request object.
Parameters
- $request
- A request object.
- $resultUrl
Result URL to split. REsult URL
still could contain domain part
or base path replacements.
- $domainParams
Array with params for first URL
part (scheme, domain, base path).
- $domainParamsFlag
Second route flag about domain
without value about base path.
This value contains info what
percentage replacements was
contained in reverse pattern.
|
protected
string[]
|
#
urlAbsPartAndSplitByReverseBasePath( MvcCore\IRequest $request, string $resultUrl, array & $domainParams, boolean $splitUrl )
After final URL is completed, split result URL into two parts if there
is contained domain part and base path in reverse, what is base material
to complete result URL. If there is found base path percentage
replacement in result url, split url after that percentage replacement
and replace that part with domain param value or request base path value.
After final URL is completed, split result URL into two parts if there
is contained domain part and base path in reverse, what is base material
to complete result URL. If there is found base path percentage
replacement in result url, split url after that percentage replacement
and replace that part with domain param value or request base path value.
Parameters
- $request
- A request object.
- $resultUrl
Result URL to split. Result URL still could
contain domain part or base path replacements.
- $domainParams
Array with params for first URL part (scheme,
domain, base path).
- $splitUrl
Boolean value about to split completed result URL
into two parts or not. Default is FALSE to return
a string array with only one record - the result
URL. If TRUE , result url is split into two
parts and function return array with two items.
Returns
string[] Result URL address in array. If last argument is
FALSE by default, this function returns only
single item array with result URL. If last
argument is TRUE , function returns result URL
in two parts - domain part with base path and
path part with query string.
|
protected
string[]
|
#
urlAbsPartAndSplitByRequestedBasePath( MvcCore\IRequest $request, string $resultUrl, boolean $splitUrl )
After final URL is completed, split result URL into two parts if there
is contained domain part and base path in reverse, what is base material
to complete result URL. Try to found the point in result URL, where is
base path end and application request path begin. By that point split and
return result URL.
After final URL is completed, split result URL into two parts if there
is contained domain part and base path in reverse, what is base material
to complete result URL. Try to found the point in result URL, where is
base path end and application request path begin. By that point split and
return result URL.
Parameters
- $request
- A request object.
- $resultUrl
Result URL to split. Result URL still could
contain domain part or base path replacements.
- $splitUrl
Boolean value about to split completed result URL
into two parts or not. Default is FALSE to return
a string array with only one record - the result
URL. If TRUE , result url is split into two
parts and function return array with two items.
Returns
string[] Result URL address in array. If last argument is
FALSE by default, this function returns only
single item array with result URL. If last
argument is TRUE , function returns result URL
in two parts - domain part with base path and
path part with query string.
|
protected
string[]
|
#
urlAbsPartAndSplitByGlobalSwitchOrBasePath( MvcCore\IRequest $request, string $resultUrl, array & $domainParams, boolean $domainParamsFlag, boolean $splitUrl )
After final URL is completed and if there is contained no scheme, no
domain part and no base path part in route pattern (or reverse), then make
checks if it needs scheme part, domain part or base path part by global
route flag property absolute or by given params. Then complete absolute
part and return result URL as single array record or split result URL by
base path end point.
After final URL is completed and if there is contained no scheme, no
domain part and no base path part in route pattern (or reverse), then make
checks if it needs scheme part, domain part or base path part by global
route flag property absolute or by given params. Then complete absolute
part and return result URL as single array record or split result URL by
base path end point.
Parameters
- $request
- A request object.
- $resultUrl
Result URL to split. Result URL still could
contain domain part or base path replacements.
- $domainParams
Array with params for first URL part (scheme,
domain, base path).
- $domainParamsFlag
- Route second int flag value without base path.
- $splitUrl
Boolean value about to split completed result URL
into two parts or not. Default is FALSE to return
a string array with only one record - the result
URL. If TRUE , result url is split into two
parts and function return array with two items.
Returns
string[] Result URL address in array. If last argument is
FALSE by default, this function returns only
single item array with result URL. If last
argument is TRUE , function returns result URL
in two parts - domain part with base path and
path part with query string.
|
protected
array
|
#
urlGetAndRemoveDomainPercentageParams( array & $params = [] )
Return TRUE if there are any domain params or absolute boolean flag
found in given $params array. All those domain params and possible
absolute flag unset from given $params array and return it in result
array as domain params. Keys as param name, values as domain param value.
Return TRUE if there are any domain params or absolute boolean flag
found in given $params array. All those domain params and possible
absolute flag unset from given $params array and return it in result
array as domain params. Keys as param name, values as domain param value.
Parameters
Returns
array
|
protected
string
&
|
#
urlCorrectTrailingSlashBehaviour( string & $urlPath )
Correct last character in path element completed in Url() method by
cached router configuration protected property
\MvcCore\Router::$trailingSlashBehaviour; .
Correct last character in path element completed in Url() method by
cached router configuration protected property
\MvcCore\Router::$trailingSlashBehaviour; .
Parameters
Returns
string
|