CanonicalMetaTagManager
final class \
- Implements
- MetaTagManagerInterface
Holds the canonical URL of the page and renders it as <link rel="canonical">.
The URL is part of the meta tag state, which is stored in the page cache and rendered after uncached content objects have been processed. This allows uncached plugins to replace or remove the canonical URL via the property "canonical".
Internal
this class is not part of TYPO3's Core API, use the MetaTagManagerRegistry with the property "canonical".
Attributes
- #[AsMetaTagManager]
- $identifier: 'canonical'
Table of Contents
Interfaces
Methods
- addProperty() : void
- A page has a single canonical URL, so any added value replaces the previous one.
- canHandleProperty() : bool
- Check if this manager can handle the given property
- getAllHandledProperties() : array
- Returns an array with all properties that can be handled by the manager
- getProperty() : array
- Get a specific property that is set before
- getState() : array
- removeAllProperties() : void
- Unset all properties of this MetaTagManager
- removeProperty() : void
- Remove one property from the MetaTagManager If there are multiple occurrences of a property, they all will be removed
- renderAllProperties() : string
- Render all registered properties of this manager
- renderProperty() : string
- Render a meta tag for a specific property
- updateState() : void
Methods
addProperty()
A page has a single canonical URL, so any added value replaces the previous one.
public
addProperty(string $property, string $content[, array $subProperties = [] ][, bool $replace = false ][, string $type = '' ]) : void
Parameters
- $property : string
- $content : string
- $subProperties : array = []
- $replace : bool = false
- $type : string = ''
canHandleProperty()
Check if this manager can handle the given property
public
canHandleProperty(string $property) : bool
Parameters
- $property : string
Return values
boolgetAllHandledProperties()
Returns an array with all properties that can be handled by the manager
public
getAllHandledProperties() : array
Return values
arraygetProperty()
Get a specific property that is set before
public
getProperty(string $property[, string $type = '' ]) : array
Parameters
- $property : string
- $type : string = ''
Return values
arraygetState()
public
getState() : array
Return values
arrayremoveAllProperties()
Unset all properties of this MetaTagManager
public
removeAllProperties() : void
removeProperty()
Remove one property from the MetaTagManager If there are multiple occurrences of a property, they all will be removed
public
removeProperty(string $property[, string $type = '' ]) : void
Parameters
- $property : string
- $type : string = ''
renderAllProperties()
Render all registered properties of this manager
public
renderAllProperties([DocType|null $docType = null ]) : string
Parameters
- $docType : DocType|null = null
Return values
stringrenderProperty()
Render a meta tag for a specific property
public
renderProperty(string $property[, DocType|null $docType = null ]) : string
Parameters
- $property : string
- $docType : DocType|null = null
Return values
stringupdateState()
public
updateState(array $state) : void
Parameters
- $state : array