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 | $includedQuerystringParameters | The list of query string parameters to be included from generated canonical URLs. |
|
protected string[] | $pathArguments | The list of path arguments to be included in canonical URLs. |
Methods
__construct(ResolverManagerInterface $resolver, Numbers $valn, string[]|Traversable $includedQuerystringParameters)
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.
string[]|null
getPathArguments()
Get path arguments to append canonical URLs
setPathArguments(string[] $pathArguments)
Set path arguments to append canonical URLs
void
addIncludedQuerystringParameter(string $parameter)
No description
array
getIncludedQuerystringParameters()
No description
Details
__construct(ResolverManagerInterface $resolver, Numbers $valn, string[]|Traversable $includedQuerystringParameters)
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.
string[]|null
getPathArguments()
Get path arguments to append canonical URLs
setPathArguments(string[] $pathArguments)
Set path arguments to append canonical URLs
void
addIncludedQuerystringParameter(string $parameter)
Since: 9.0.3
No description
array
getIncludedQuerystringParameters()
Since: 9.2.X
No description