Back to Document class

Method __construct

public
__construct
(mixed $options = array())
Class constructor.
Parameters
  • array $options Associative array of options
Since
  • 1.7.0
Class: Document
Project: Joomla

Method __construct - Source code

/**
 * Class constructor.
 *
 * @param   array  $options  Associative array of options
 *
 * @since   1.7.0
 */
public function __construct($options = array())
{
    if (\array_key_exists('lineend', $options)) {
        $this->setLineEnd($options['lineend']);
    }
    if (\array_key_exists('charset', $options)) {
        $this->setCharset($options['charset']);
    }
    if (\array_key_exists('language', $options)) {
        $this->setLanguage($options['language']);
    }
    if (\array_key_exists('direction', $options)) {
        $this->setDirection($options['direction']);
    }
    if (\array_key_exists('tab', $options)) {
        $this->setTab($options['tab']);
    }
    if (\array_key_exists('link', $options)) {
        $this->setLink($options['link']);
    }
    if (\array_key_exists('base', $options)) {
        $this->setBase($options['base']);
    }
    if (\array_key_exists('mediaversion', $options)) {
        $this->setMediaVersion($options['mediaversion']);
    }
    if (\array_key_exists('factory', $options)) {
        $this->setFactory($options['factory']);
    } else {
        $this->setFactory(new Factory());
    }
    if (\array_key_exists('preloadManager', $options)) {
        $this->setPreloadManager($options['preloadManager']);
    } else {
        $this->setPreloadManager(new PreloadManager());
    }
    if (\array_key_exists('webAssetManager', $options)) {
        $this->setWebAssetManager($options['webAssetManager']);
    } else {
        $webAssetManager = new WebAssetManager(\Joomla\CMS\Factory::getContainer()->get('webassetregistry'));
        $this->setWebAssetManager($webAssetManager);
    }
}