public \Joomla\CMS\Document\Document
setMetaData
(mixed $name, mixed $content, mixed $attribute = 'name')
/**
* Sets or alters a meta tag.
*
* @param string $name Name of the meta HTML tag
* @param mixed $content Value of the meta HTML tag as array or string
* @param string $attribute Attribute to use in the meta HTML tag
*
* @return Document instance of $this to allow chaining
*
* @since 1.7.0
*/
public function setMetaData($name, $content, $attribute = 'name')
{
// Pop the element off the end of array if target function expects a string or this http_equiv parameter.
if (\is_array($content) && (\in_array($name, array('generator', 'description')) || !\is_string($attribute))) {
$content = array_pop($content);
}
// B/C old http_equiv parameter.
if (!\is_string($attribute)) {
$attribute = $attribute == true ? 'http-equiv' : 'name';
}
if ($name === 'generator') {
$this->setGenerator($content);
} elseif ($name === 'description') {
$this->setDescription($content);
} else {
$this->_metaTags[$attribute][$name] = $content;
}
return $this;
}