src/Support/View/AssetManager.php
public function registerScript($script, $once = true)
    {
        if ( ! $once) {
            $this->scripts[] = $script;

            return $this;
        }

        // Make sure the script is added only once
        $hash = md5($script);

        if (array_key_exists($hash, $this->scriptHashes)) {
            return $this;
        }

        $this->scripts[] = $script;

        // Map the hash for adding the script only once
        end($this->scripts);
        $index = key($this->scripts);

        $this->scriptHashes[$hash] = $index;

        return $this;
    }
public function registerScript($script, $once = true)
    {
        if ( ! $once) {
            $this->scripts[] = $script;

            return $this;
        }

        // Make sure the script is added only once
        $hash = md5($script);

        if (array_key_exists($hash, $this->scriptHashes)) {
            return $this;
        }

        $this->scripts[] = $script;

        // Map the hash for adding the script only once
        end($this->scripts);
        $index = key($this->scripts);

        $this->scriptHashes[$hash] = $index;

        return $this;
    }
public function registerScript ( $ script , $ once = true ) { if ( ! $ once ) { $ this -> scripts [ ] = $ script ; return $ this ; } // Make sure the script is added only once $ hash = md5 ( $ script ) ; if ( array_key_exists ( $ hash , $ this -> scriptHashes ) ) { return $ this ; } $ this -> scripts [ ] = $ script ; // Map the hash for adding the script only once end ( $ this -> scripts ) ; $ index = key ( $ this -> scripts ) ; $ this -> scriptHashes [ $ hash ] = $ index ; return $ this ; }
Registers CMS javascript code

@param      $script
@param bool $once        if true, only registers script with these exact contents once
@return $this
Registers CMS javascript code