Back to HtmlDocument class

Method getHeadData

public array
getHeadData
()
Get the HTML document head data
Returns
  • array The document head data in array form
Since
  • 1.7.0
Class: HtmlDocument
Project: Joomla

Method getHeadData - Source code

/**
 * Get the HTML document head data
 *
 * @return  array  The document head data in array form
 *
 * @since   1.7.0
 */
public function getHeadData()
{
    $data = array();
    $data['title'] = $this->title;
    $data['description'] = $this->description;
    $data['link'] = $this->link;
    $data['metaTags'] = $this->_metaTags;
    $data['links'] = $this->_links;
    $data['styleSheets'] = $this->_styleSheets;
    $data['style'] = $this->_style;
    $data['scripts'] = $this->_scripts;
    $data['script'] = $this->_script;
    $data['custom'] = $this->_custom;
    // @deprecated 5.0  This property is for backwards compatibility. Pass text through script options in the future
    $data['scriptText'] = Text::getScriptStrings();
    $data['scriptOptions'] = $this->scriptOptions;
    // Get Asset manager state
    $wa = $this->getWebAssetManager();
    $waState = $wa->getManagerState();
    // Get asset objects and filter only manually added/enabled assets,
    // Dependencies will be picked up from registry files
    $waState['assets'] = [];
    foreach ($waState['activeAssets'] as $assetType => $assetNames) {
        foreach ($assetNames as $assetName => $assetState) {
            $waState['assets'][$assetType][] = $wa->getAsset($assetType, $assetName);
        }
    }
    // We have loaded asset objects, now can remove unused stuff
    unset($waState['activeAssets']);
    $data['assetManager'] = $waState;
    return $data;
}