src/Renderer/ViewHelper/ScriptHelper.php
private function parseArgs(array $args) : string
    {
        if (!is_array($args)) return false;
        $components = array();
        if (count($args) == 1 && is_string($args[0])) {
            $components['src'] = $args[0];
            return $this->makeLink($components);
        } elseif (count($args) == 1 && is_array($args)) {
            $components = $args[0];
            return $this->makeLink($components);
        } elseif (count($args) == 2 && is_string($args[0]) && is_array($args[1])) {
            $args[1]['src'] = $args[0];
            $components = $args[1];
            return $this->makeLink($components);
        } elseif (count($args) == 2 && is_string($args[0]) && is_string($args[1])) {
            return '<script type="'.$args[1].'">'."\n".$args[0]."\n</script>\n";
        }
        Core::i()->log->warning('Unable to interpret script. Not added.');
        return false;
    }
private function parseArgs(array $args) : string
    {
        if (!is_array($args)) return false;
        $components = array();
        if (count($args) == 1 && is_string($args[0])) {
            $components['src'] = $args[0];
            return $this->makeLink($components);
        } elseif (count($args) == 1 && is_array($args)) {
            $components = $args[0];
            return $this->makeLink($components);
        } elseif (count($args) == 2 && is_string($args[0]) && is_array($args[1])) {
            $args[1]['src'] = $args[0];
            $components = $args[1];
            return $this->makeLink($components);
        } elseif (count($args) == 2 && is_string($args[0]) && is_string($args[1])) {
            return '<script type="'.$args[1].'">'."\n".$args[0]."\n</script>\n";
        }
        Core::i()->log->warning('Unable to interpret script. Not added.');
        return false;
    }
private function parseArgs ( array $ args ) : string { if ( ! is_array ( $ args ) ) return false ; $ components = array ( ) ; if ( count ( $ args ) == 1 && is_string ( $ args [ 0 ] ) ) { $ components [ 'src' ] = $ args [ 0 ] ; return $ this -> makeLink ( $ components ) ; } elseif ( count ( $ args ) == 1 && is_array ( $ args ) ) { $ components = $ args [ 0 ] ; return $ this -> makeLink ( $ components ) ; } elseif ( count ( $ args ) == 2 && is_string ( $ args [ 0 ] ) && is_array ( $ args [ 1 ] ) ) { $ args [ 1 ] [ 'src' ] = $ args [ 0 ] ; $ components = $ args [ 1 ] ; return $ this -> makeLink ( $ components ) ; } elseif ( count ( $ args ) == 2 && is_string ( $ args [ 0 ] ) && is_string ( $ args [ 1 ] ) ) { return '<script type="' . $ args [ 1 ] . '">' . "\n" . $ args [ 0 ] . "\n</script>\n" ; } Core :: i ( ) -> log -> warning ( 'Unable to interpret script. Not added.' ) ; return false ; }
Builds the tag based on the passed info.
@param array $args
@return string
Builds the tag based on the passed info .