UrlService
This service class contains functions related to url generation etc.
All public functions are available in the Twig template renderer.
Namespace
IO\Services
Type | Name | Description |
---|---|---|
|
||
|
Methods
public __construct($webstoreConfigurationRepository)
UrlService constructor.
Type |
Name |
Description |
|
public getCategoryURL($categoryId, $lang = null, $webstoreId = null):UrlQuery
Get canonical URL for a category
Type |
Name |
Description |
|
A category id to get the URL for |
|
|
Optional: A language for the URL (ISO-639-1) (Default: The current language) |
|
|
Optional: A webstore id (Default: The current webstore id) |
public getVariationURL($itemId, $variationId, $lang = null):UrlQuery
Get canonical URL for a variation
Type |
Name |
Description |
|
An item id to get URL for |
|
|
An variation id to get URL for |
|
|
Optional: A language to get URL for (ISO-639-1) (Default: The current language) |
public getCanonicalURL($lang = null, $ignoreCanonical = false):string
Get canonical URL for current page
Type |
Name |
Description |
|
Optional: Language for the URL |
|
|
Optional: If true, get canonical from category details (Default: false) |
public getCanonicalQueryString():string
Get query string from URI, return an empty string if its an canonical link from category details
public isCanonical($lang = null):bool
Check if the current URL is canonical
Type |
Name |
Description |
|
Optional: A language for the check (Default: The current language) |
public getLanguageURLs():array
Get equivalent canonical URLs for each active language
public getHomepageURL():string
Deprecated!
since 4.3.0 Use IO\Extensions\Constants\ShopUrls::$home instead. |
Get language specific homepage URL
public redirectTo($redirectURL):mixed
Redirects to the given URL
Type |
Name |
Description |
|
public isRouteEnabled($route):bool
Check if route is enabled or category is linked to route.
Type |
Name |
Description |
|
public fromMemoryCache()
public resetMemoryCache($key = null)
Type |
Name |
Description |
|