FOF30\Template\Template::addJSInline PHP Method

addJSInline() public method

Adds an inline JavaScript script to the page header
public addJSInline ( string $script, string $type = 'text/javascript' )
$script string The script content to add
$type string The MIME type of the script
    public function addJSInline($script, $type = 'text/javascript')
    {
        if ($this->container->platform->isCli()) {
            return;
        }
        $document = $this->container->platform->getDocument();
        if (!method_exists($document, 'addScriptDeclaration')) {
            return;
        }
        $document->addScriptDeclaration($script, $type);
    }