Trait UrlByRoute
Methods summary
public
string
|
#
UrlByRoute( MvcCore\IRoute $route, array & $params = [], string $urlParamRouteName = NULL )
Complete non-absolute, url by route instance reverse info with special
media type prefix or without the prefix. If there is key media_version
in $params , unset this param before route URL completing and choose by
this param url prefix to prepend completed URL string.
Example:
Input (\MvcCore\Route::$reverse ):
"/products-list/<name>/<color>"
Input ($params):
array(
"name" => "cool-product-name",
"color" => "red",
"variant" => ["L", "XL"],
"media_version" => "mobile",
);
Output:
/application/base-bath/m/products-list/cool-product-name/blue?variant[]=L&variant[]=XL"
Complete non-absolute, url by route instance reverse info with special
media type prefix or without the prefix. If there is key media_version
in $params , unset this param before route URL completing and choose by
this param url prefix to prepend completed URL string.
Example:
Input (\MvcCore\Route::$reverse ): "/products-list/<name>/<color>"
Input ($params): array( "name" => "cool-product-name", "color" => "red", "variant" => ["L", "XL"], "media_version" => "mobile", );
Output: /application/base-bath/m/products-list/cool-product-name/blue?variant[]=L&variant[]=XL"
Parameters
- $route
- $route
- $params
- $urlParamRouteName
Returns
string
|