Generate a tag

@param $href
@param string $content
@param string $title
@param string $target
@param array $options
@return string
357035
public static function a($href, $content = '', $title = '', $target = '', $options = [])
    {
        $a_tag_tpl = '<a href="%s" title="%s" target="%s"%s>%s</a>';
        return sprintf($a_tag_tpl, $href, $title, $target, self::assembleTagOptions($options), $content);
    }
1002303
public function addAction($title, $link, array $options = [])
    {
        if (is_array($link)) {
            if (!isset($link['p'])) {
                $link['p'] = P;
            }
            if (!isset($link['do'])) {
                $link['do'] = P_DO;
            }

            // Removed "_default" from main action if called from Main and is the beginning of string
            if (stripos($link['do'], '_default') === 0) {
                $link['do'] = str_replace('_default_', '', $link['do']);
            }

            $link = Linker::makeUrl($link);
        }

        $options['link'] = $link;
        $this->actions[$title] = $options;

        return $this;
    }
495983
public function link($title, $url = null, array $options = [])
    {
        $options = optionsParser($options, ['escape' => false, 'title' => $title]);
        $options->add('title', trim(h(strip_tags($options->get('title')))))->tooltip();
        list($title, $options) = $this->addIconToText($title, $options);

        return parent::link($title, $url, $options->toArray());
    }
580125
private function generateFile($content, $chunkPath, array $options)
    {
        $data = new ContentData($content, $options);

        $this->outputGenerator->reset();
        $this->outputGenerator->startDocument($data);

        $contents = array();
        foreach ($data->contents as $contentTypes) {
            foreach ($contentTypes as $contentType) {
                $contents[] = $contentType;
            }
        }

        $this->contentListElementGenerator->generateElement($this->outputGenerator, $contents);

        unset($contents);

        $filePath = $this->fileSystemHelper->getDir() . $chunkPath;
        $this->fileSystemHelper->save($filePath, $this->outputGenerator->endDocument($data));

        unset($data);

        $this->logger->info(sprintf('Generating file: %s', $filePath));
    }
229298
public static function select(
        string $content, 
        array $attributes = [],
        array $options = []
    ) : string
    {
        foreach ($options as $key => $val) {
            $content .= $this->option($key, ["value" => $val]);
        }
        return self::tag("select", $content, $attributes);
    }
1271591
public static function linkDropdown($title, $links, $options = [])
    {
        $lis = '';
        foreach ($links as $name => $url) {
            $lis .= Html::tag('li', Html::a($name, $url));
        }

        return Html::beginTag('div', ['class' => 'btn-group'])
        . Html::button($title . '<span class="caret"></span>',
            array_merge(['class' => 'btn dropdown-toggle btn-primary', "data-toggle"=>"dropdown"], $options))
        . Html::beginTag('ul', ['class'=>'dropdown-menu'])
        . $lis
        . Html::endTag('ul')
        . Html::endTag('div');
    }
577828
public static function tag($name, $content = NULL, Array $attributes = NULL) {
    return \Psc\UI\HTML::tag($name, $content, $attributes);
  }
512847
public static function link($href = '', $text = '', array $attributes = [])
    {
        $attributes = array_merge([
            'href'  => $href,
        ], $attributes);

        return self::tag('a', $attributes)->text($text);
    }
458411
public function parseBlock(Text $content, Container $target)
    {
        $tags = implode('|', $this->getValidTags());

        $content->handle(
            '{
                ^                        # starts at the beginning or with a newline
                [ ]{0,3}                 # up to 3 leading spaces allowed
                (?:                      # start with one of the following...
                    \<(?:'.$tags.')\s*/?\>?|    # an opening HTML tag, or
                    \</(?:'.$tags.')\s*\>|      # a closing HTML tag, or
                    \<!--(-(?!-)|[^\-])*?--\>|  # a HTML comment, or
                    \<\?.*?\?\>|                # a processing instruction, or
                    \<![A-Z]+\s+[^>]+\>|        # an element type declaration, or
                    \<!\[CDATA\[.*?\]\]\>       # a CDATA section
                )
                .*?                      # match everything until...
                ((?=\\n[ ]*\\n)|\Z)      # we encounter an empty line or the end
            }imsx',
            function (Text $content) use ($target) {
                $block = new HTMLBlock($content);

                $target->addChild($block);
            },
            function (Text $part) use ($target) {
                $this->next->parseBlock($part, $target);
            }
        );
    }
125141
public static function link(
        string $content = null, 
        array $attributes = []
    ) : string
    {
        return self::tag("link", $content, $attributes);
    }
692166
public function tag($name, Array $options = array(), $content = null, $open = false)
    {
        if (!$name) {
            return '';
        }
        $htmlOptions = '';
        foreach ($options as $key => $value) {
            $htmlOptions .= ' ' . $key . '="' . \htmlspecialchars($value, \ENT_COMPAT) . '"';
        }
        if ($content !== null) {
            return '<' . $name . $htmlOptions . '>' . $content . '</' . $name . '>';
        } else {
            return '<' . $name . $htmlOptions . (($open) ? '>' : ' />');
        }
    }
1319244
public function linkTo($text, $urlOptions, array $attrs = [])
    {
        $url = $this->parseUrlOptions($urlOptions);
        return $this->contentTag('a', $text, array_merge(['href' => $url], $attrs));
    }
580802
public function link($title, $url = null, array $options = [])
    {
        $options = $this->addClass($options, $this->_class(__FUNCTION__));
        $options = Hash::merge([
            'escapeTitle' => false,
            'clear'       => false,
            'label'       => $title,
        ], $options);

        $isClear = (bool) $options['clear'];
        unset($options['clear']);

        $options = $this->_setTitleAttr($title, $options);

        //  Set title in html tag.
        if ($this->_isEscapeTitle($title, $isClear, $options)) {
            $title = $this->tag('span', $title, ['class' => $this->_class(__FUNCTION__) . '-title']);
        }

        $options = $this->_getBtnClass($options);
        $options = $this->_getToolTipAttr($options);

        list($title, $options) = $this->_createIcon($this, $title, $options);
        unset($options['label']);

        return parent::link($title, $url, $options);
    }
67079
public static function anchor(string $title, string $url = '', array $attributes = null) : string
    {
        // Add link
        if ($url !== '') $attributes['href'] = $url;
        return '<a'.Html::attributes($attributes).'>'.$title.'</a>';
    }
253274
protected function _renderTag($attribs = array(), $content = null)
    {
        if($this->getTemplate()->decorator() == 'joomla')
        {
            $link      = isset($attribs['href']) ? $attribs['href'] : false;
            $relType  = 'rel';
            $relValue = $attribs['rel'];
            unset($attribs['rel']);
            unset($attribs['href']);

            JFactory::getDocument()->addHeadLink($link, $relValue, $relType, $attribs);
        }
        else return parent::_renderTag($attribs, $content);
    }
4483
public function tag($tag, $attr = null, $content = null, $close = false)
    {
        $tag = strtolower($tag);

        if (! empty($attr) && is_array($attr)) {
            $attr = $this->Attr->attr($attr);
        }

        if ($close) {
            return sprintf('<%s%s>%s</%1$s>', $tag, $attr, $content);
        } else {
            return sprintf('<%s%s>', $tag, $attr);
        }
    }
1074109
public function unprotectedLink($title, $url, $options = [])
    {
        $url = $this->_getUrl($url);
        return $this->link($title, $url, $options);
    }