Back to HtmlDocument class

Method resetHeadData

public \Joomla\CMS\Document\HtmlDocument
resetHeadData
(mixed $types = null)
Reset the HTML document head data
Parameters
  • mixed $types type or types of the heads elements to reset
Returns
  • \Joomla\CMS\Document\HtmlDocument instance of $this to allow chaining
Since
  • 3.7.0
Class: HtmlDocument
Project: Joomla

Method resetHeadData - Source code

/**
 * Reset the HTML document head data
 *
 * @param   mixed  $types  type or types of the heads elements to reset
 *
 * @return  HtmlDocument  instance of $this to allow chaining
 *
 * @since   3.7.0
 */
public function resetHeadData($types = null)
{
    if (\is_null($types)) {
        $this->title = '';
        $this->description = '';
        $this->link = '';
        $this->_metaTags = array();
        $this->_links = array();
        $this->_styleSheets = array();
        $this->_style = array();
        $this->_scripts = array();
        $this->_script = array();
        $this->_custom = array();
        $this->scriptOptions = array();
    }
    if (\is_array($types)) {
        foreach ($types as $type) {
            $this->resetHeadDatum($type);
        }
    }
    if (\is_string($types)) {
        $this->resetHeadDatum($types);
    }
    return $this;
}