public \Joomla\CMS\Document\Document
addScriptOptions
(mixed $key, mixed $options, mixed $merge = true)
/**
* Add option for script
*
* @param string $key Name in Storage
* @param mixed $options Scrip options as array or string
* @param bool $merge Whether merge with existing (true) or replace (false)
*
* @return Document instance of $this to allow chaining
*
* @since 3.5
*/
public function addScriptOptions($key, $options, $merge = true)
{
if (empty($this->scriptOptions[$key])) {
$this->scriptOptions[$key] = array();
}
if ($merge && \is_array($options)) {
$this->scriptOptions[$key] = array_replace_recursive($this->scriptOptions[$key], $options);
} else {
$this->scriptOptions[$key] = $options;
}
return $this;
}