abstract protected
array
|
#
urlByRouteSections( MvcCore\IRoute $route, array & $params = [], string $urlParamRouteName = NULL )
Complete semi-finished result URL as two section strings and system
params array. First section as base section with scheme, domain and base
path, second section as application requested path and query string and
third section as system params like localization or media_version .
Those params could be inserted between first two sections as system
params in result URL by router behaviour and default values. Or it could
be inserted into domain part in more extended routers.
Example:
Input (\MvcCore\Route::$reverse ):
[
"en" => "/products-list/<name>/<color>" ,
"de" => "/produkt-liste//",
]
Input ($params):
array(
"name" => "cool-product-name",
"color" => "red",
"variant" => ["L", "XL"],
"localization" => "en-US",
"media_version" => "mobile",
);
Output:
[
"/application/base/bath",
"/products-list/cool-product-name/blue?variant[]=L&variant[]=XL",
["media_version" => "m", "localization" => "en-US"]
]
Complete semi-finished result URL as two section strings and system
params array. First section as base section with scheme, domain and base
path, second section as application requested path and query string and
third section as system params like localization or media_version .
Those params could be inserted between first two sections as system
params in result URL by router behaviour and default values. Or it could
be inserted into domain part in more extended routers.
Example:
Input (\MvcCore\Route::$reverse ):
[ "en" => "/products-list/<name>/<color>" , "de" => "/produkt-liste//",
]
Input ($params): array( "name" => "cool-product-name", "color" => "red", "variant" => ["L", "XL"], "localization" => "en-US", "media_version" => "mobile", );
Output: [ "/application/base/bath", "/products-list/cool-product-name/blue?variant[]=L&variant[]=XL", ["media_version" => "m", "localization" => "en-US"] ]
Parameters
- $route
- $params
- $urlParamRouteName
Returns
array
string $urlBaseSection, string $urlPathWithQuerySection, array $systemParams
|
protected
string
|
#
urlByRoutePrefixSystemParams( string $urlBaseSection, string $urlPathWithQuerySection, array $systemParams = [], boolean $urlPathWithQueryIsHome = NULL )
Complete final URL, simply concatenate strings from three given sources:
- $urlBaseSection
- Begin URL part containing http, domain and base path like:
https://domain.com/path/to/app
- $urlPathWithQuerySection
- Subject url part with application path and possible query string:
/some/path?with=query
- $systemParams
- Array to implode it's values into string with system params
like media site version or localization:
['media_version' => 'm', 'localization' => 'en-US']
Example output:
- https://domain.com/path/to/app/m/en-US/some/path?with=query
Complete final URL, simply concatenate strings from three given sources:
- $urlBaseSection - Begin URL part containing http, domain and base path like: https://domain.com/path/to/app
- $urlPathWithQuerySection - Subject url part with application path and possible query string: /some/path?with=query
- $systemParams - Array to implode it's values into string with system params like media site version or localization: ['media_version' => 'm', 'localization' => 'en-US']
Example output:
- https://domain.com/path/to/app/m/en-US/some/path?with=query
Parameters
- $urlBaseSection
- URL section with domain part and possible base path part.
- $urlPathWithQuerySection
- URL section with path and query string.
- $systemParams
- System params to create URL prefixes from array values.
- $urlPathWithQueryIsHome
TRUE if URL section with path and query string targets /
(or /index.php - request script name)
Returns
string
|