function js($flush = true) {
        $js = $this->_js;
        if ($flush) $this->_js = [];
        $html = '';
        foreach ($js as $url => $inc) {
            $html .= '<script src="'.$url.'"></script>'.PHP_EOL;
        }
        if (!empty($this->_scripts)) {
            $scripts = $this->_scripts;
            if ($flush) $this->_scripts = [];
            $html .= '<script>'.PHP_EOL;
            foreach ($scripts as $script) {
                $html .= $script . PHP_EOL;
            }
            $html .= '</script>';
        }
        return $html;
    }
function js($flush = true) {
        $js = $this->_js;
        if ($flush) $this->_js = [];
        $html = '';
        foreach ($js as $url => $inc) {
            $html .= '<script src="'.$url.'"></script>'.PHP_EOL;
        }
        if (!empty($this->_scripts)) {
            $scripts = $this->_scripts;
            if ($flush) $this->_scripts = [];
            $html .= '<script>'.PHP_EOL;
            foreach ($scripts as $script) {
                $html .= $script . PHP_EOL;
            }
            $html .= '</script>';
        }
        return $html;
    }
function js ( $ flush = true ) { $ js = $ this -> _js ; if ( $ flush ) $ this -> _js = [ ] ; $ html = '' ; foreach ( $ js as $ url => $ inc ) { $ html .= '<script src="' . $ url . '"></script>' . PHP_EOL ; } if ( ! empty ( $ this -> _scripts ) ) { $ scripts = $ this -> _scripts ; if ( $ flush ) $ this -> _scripts = [ ] ; $ html .= '<script>' . PHP_EOL ; foreach ( $ scripts as $ script ) { $ html .= $ script . PHP_EOL ; } $ html .= '</script>' ; } return $ html ; }
Returns HTML for including all added js assets
@param bool $flush Clean all added js assets or not
@return string
Returns HTML for including all added js assets