SeoCanonical
class SeoCanonical (View source)
Helper class to work with SEO canonical URLs.
Properties
protected ResolverManagerInterface | $resolver | The instance of the class that builds page URLs. |
|
protected Numbers | $valn | The instance of the numbers validator. |
|
protected string[]|Traversable | $excludedQuerystringParameters | The list of query string parameters to be excluded from generated canonical URLs. |
Methods
__construct(ResolverManagerInterface $resolver, Numbers $valn, string[]|Traversable $excludedQuerystringParameters)
Initialize the instance.
URLInterface|null
getPageCanonicalURL(Page|int $page, Request|ParameterBag|Query|array|string|null $querystring = null)
Generate the canonical URL of a page.
Element|null
getPageCanonicalURLTag(Page|int $page, Request|ParameterBag|Query|array|string|null $querystring = null)
Generate the tag of a page.
Details
__construct(ResolverManagerInterface $resolver, Numbers $valn, string[]|Traversable $excludedQuerystringParameters)
Initialize the instance.
URLInterface|null
getPageCanonicalURL(Page|int $page, Request|ParameterBag|Query|array|string|null $querystring = null)
Generate the canonical URL of a page.
Element|null
getPageCanonicalURLTag(Page|int $page, Request|ParameterBag|Query|array|string|null $querystring = null)
Generate the tag of a page.