Builds html tag

@param string $name
@param        $arguments
@return string
961477
private static function buildTag(string $name, $arguments): string
    {
        $tagConf = static::$tagsData[$name];
        $hasValue = (boolean)$tagConf['hasValue'];
        $clear = \iterator_to_array($tagConf['clearAttributes'], true);
        $default = \iterator_to_array($tagConf['defaultAttributes'], true);

        $tagName = $name == 'vartag' ? 'var' : $name;
        $tagValue = static::getTagContent($arguments, $hasValue);
        $attributes = static::getTagAttributes($arguments, $hasValue);
        $attributes = static::clearAttributes($attributes, $clear);
        $attributes = static::setDefaultAttributes($attributes, $default);
        $newLine = '';

        if (\is_array($tagValue)) {
            $tagValue = \implode(static::CRLF, $tagValue);
            $newLine = static::CRLF;
        } elseif (\in_array($tagName, ['body', 'head', 'html'])) {
            $newLine = static::CRLF;
        }

        if ($hasValue === true) {
            return \sprintf(
                '<%s%s>%s%s%s</%s>%s',
                $tagName,
                static::extractAttributes($attributes),
                $newLine,
                \rtrim(\str_replace(static::CRLF.static::CRLF, static::CRLF, $tagValue), static::CRLF),
                $newLine,
                $tagName,
                $newLine
            );
        }

        if (\in_array($tagName, ['iframe'])) {
            return \sprintf('<%s%s></%s>', $tagName, static::extractAttributes($attributes), $tagName);
        }

        return \sprintf('<%s%s/>', $tagName, static::extractAttributes($attributes));
    }
505160
protected function setKey(string $name, array $arguments): string
    {
        $prefix = $this->cachePrefix($name);
        $cacheKey = sha1($prefix.serialize($arguments));
        $this->cacheKeys[$prefix] = $cacheKey;

        return $cacheKey;
    }
1234747
public function getHtml($name = null)
    {
        $host = self::API_SERVER;

        $langOption = '';

        if (isset($this->options['lang']) && ! empty($this->options['lang'])) {
            $langOption = "?hl={$this->options['lang']}";
        }

        $return = <<<HTML
<script type="text/javascript" src="{$host}{$langOption}" async defer></script>
HTML;

        return $return;
    }
593522
public function contentTag($name, $content, array $options = array(), $escape = false)
    {
        if ($content instanceof \Closure) {
            ob_start();
            $ret     = $content();
            $content = ob_get_clean();
            if ($ret !== null) {
                $content = $ret;
            }
        }
        return $this->contentTagString($name, $content, $options, $escape);
    }
167215
public function tag($name) {
		if (!isset($this->_tags[$name])) {
			return false;
		}
		foreach ($this->_tags[$name] as $item) {
			return $item;
		}
	}
549144
public function getTag(string $name, $default = null)
    {
        return isset($this->tags[$name]) ? $this->tags[$name] : $default;
    }
574830
public function renderSnippet($name)
    {
        if (!isset($this->snippets[$name])) {
            throw new InvalidArgumentException(
                sprintf(
                    "Cannot find a snippet with name '%s'",
                    $name
                )
            );
        }

        return $this->getView()->render(
            $this->snippets[$name]['template'],
            $this->snippets[$name]['values']
        );
    }
460467
public function render($name = null, ...$params)
    {
        return new HtmlString(
            view($this->getView(), [
                'breadcrumbs' => $this->generate($name, $params)
            ])->render()
        );
    }
215798
public function getTags($name = null)
  {
    if (!$name) return $this->tags;
    
    return isset($this->tags[$name]) ? $this->tags[$name] : [];
  }
1200734
public static function tag( $name, $attributes = array(), $value = null, $close = true, $selfClose = false )
    {
        //	Nah nah...
        if ( true !== $close )
        {
            $close = $selfClose = false;
        }

        $_html = static::openTag( $name, $attributes, $selfClose );

        if ( false !== $selfClose )
        {
            return $_html;
        }

        if ( null !== $value )
        {
            $_html .= trim( $value );
        }

        if ( $close )
        {
            $_html .= static::closeTag( $name );
        }

        return trim( $_html );
    }
688125
public static function create($name, $content = '', $attribs = [], $forcePair = false)
    {
        $name = trim($name);

        $tag = '<' . $name;

        $tag .= static::buildAttributes($attribs);

        if ($content !== null) {
            $tag .= '>' . $content . '</' . $name . '>';
        } else {
            $tag .= $forcePair ? '></' . $name . '>' : ' />';
        }

        return $tag;
    }
1334030
public function render($name, $args = []) {

        if(strstr($name, '::')) {

            $name = explode('::', $name);
        
        } else {

            $name = [$name, strtolower($name)];
        }


        if($this->set('module[controller]', $name[0])) {

            $module = $this->get('module');

            if(isset($module['name'])) {

                ob_start();

                if(method_exists($instance = $this->controller($module['name'], $name[0]), $name[1])) {

                    if($ref = new \ReflectionMethod($instance, $name[1])) {

                        $ref->invokeArgs($instance, $args);
                    }
                }

                $content = ob_get_contents();

                ob_end_clean();


                return $content;
            }
        }
    }
1292291
public static function createFromArgument(ArgumentInterface $argument)
    {
        $tag = new self();
        $tag
            ->setName(self::TAG_PARAM)
            ->setType($argument->getType())
            ->setVariable($argument->getName())
            ->setDescription($argument->getDescription())
            ->setReferenced($argument);

        return $tag;
    }
353186
public function renderContent($name, $parameters = [])
    {
        /**
         * @event cms.page.beforeRenderContent
         * Provides an oportunity to manipulate the name of the content file being rendered before it renders
         *
         * Example usage:
         *
         *     Event::listen('cms.page.beforeRenderContent', function ((\Cms\Classes\Controller) $controller, (string) $contentName) {
         *         return "path/to/overriding/location/" . $contentName;
         *     });
         *
         * Or
         *
         *     $CmsController->bindEvent('page.beforeRenderContent', function ((string) $contentName) {
         *         return "path/to/overriding/location/" . $contentName;
         *     });
         *
         */
        if ($event = $this->fireSystemEvent('cms.page.beforeRenderContent', [$name])) {
            $content = $event;
        }
        /*
         * Load content from theme
         */
        elseif (($content = Content::loadCached($this->theme, $name)) === null) {
            throw new CmsException(Lang::get('cms::lang.content.not_found_name', ['name'=>$name]));
        }

        $fileContent = $content->parsedMarkup;

        /*
         * Inject global view variables
         */
        $globalVars = ViewHelper::getGlobalVars();
        if (!empty($globalVars)) {
            $parameters = (array) $parameters + $globalVars;
        }

        /*
         * Parse basic template variables
         */
        if (!empty($parameters)) {
            $fileContent = TextParser::parse($fileContent, $parameters);
        }

        /**
         * @event cms.page.renderContent
         * Provides an oportunity to manipulate the output of a content file after being rendered
         *
         * Example usage:
         *
         *     Event::listen('cms.page.renderContent', function ((\Cms\Classes\Controller) $controller, (string) $contentName, (string) &$fileContent) {
         *         return "Overriding content";
         *     });
         *
         * Or
         *
         *     $CmsController->bindEvent('page.renderContent', function ((string) $contentName, (string) &$fileContent) {
         *         return "Overriding content";
         *     });
         *
         */
        if ($event = $this->fireSystemEvent('cms.page.renderContent', [$name, &$fileContent])) {
            return $event;
        }

        return $fileContent;
    }
1294340
public static function fa ($name, $options = [])
		{
			if (!isset($options[ 'class' ]))
				$options[ 'class' ] = '';
			$options[ 'class' ] = trim($options[ 'class' ] . ' fa fa-' . $name);

			return self::tag('i', '', $options);
		}
665666
protected function renderElement(string $name, array $options = []) : string
    {
        return $this->config->getView()
            ->element($name, $options);
    }
574864
function construct($matchrule, $name, $arguments = null)
    {
        $res = parent::construct($matchrule, $name, $arguments);
        if (!isset($res['php'])) {
            $res['php'] = '';
        }
        return $res;
    }