Заголовок на странице
@return Tag
960632
public function header($tag = 'h1', $attr = null)
  {
    return new Tag($tag, $this->getHeader() ?: $this->getTitle(), $attr);
  }
122425
protected function getLabel()
	{
		$html = array();
		$class = $this->element['class'] ? (string) $this->element['class'] : '';

		$html[] = '<span class="spacer">';
		$html[] = '<span class="before"></span>';
		$html[] = '<span class="' . $class . '">';

		if ((string) $this->element['hr'] == 'true')
		{
			$html[] = '<hr class="' . $class . '" />';
		}
		else
		{
			$label = '';

			// Get the label text from the XML element, defaulting to the element name.
			$text = $this->element['label'] ? (string) $this->element['label'] : (string) $this->element['name'];
			$text = $this->translateLabel ? $this->getText()->translate($text) : $text;

			// Build the class for the label.
			$class = !empty($this->description) ? 'hasTip' : '';
			$class = $this->required == true ? $class . ' required' : $class;

			// Add the opening label tag and main attributes attributes.
			$label .= '<label id="' . $this->id . '-lbl" class="' . $class . '"';

			// If a description is specified, use it to build a tooltip.
			if (!empty($this->description))
			{
				$label .= ' title="'
					. htmlspecialchars(
					trim($text, ':') . '::' . ($this->translateDescription ? $this->getText()->translate($this->description) : $this->description),
					ENT_COMPAT, 'UTF-8'
				) . '"';
			}

			// Add the label text and closing tag.
			$label .= '>' . $text . '</label>';
			$html[] = $label;
		}

		$html[] = '</span>';
		$html[] = '<span class="after"></span>';
		$html[] = '</span>';

		return implode('', $html);
	}
814176
public function getHTML()
    {
        $this->parse();
        $xml = clone $this->xml;

        /* Удаляем расширенные теги */
        $tags = $xml->getElementsByTagNameNS(self::NS, '*');
        while ($tags->length > 0)
        {
            $node = $tags->item(0);
            $node->parentNode->removeChild($node);
        }

        // Есть ли поля для выбора файлов?
        $hasFileInputs = false;

        /*
         * Удаляем расширенные атрибуты
         * Ищем input[type=file]
         */
        $tags = $xml->getElementsByTagName('*');
        for ($i = 0; $i < $tags->length; $i++)
        {
            $node = $tags->item($i);

            $isElement = $node->nodeType == XML_ELEMENT_NODE;
            /** @var DOMElement $node */
            $hasAttributes = $isElement && $node->hasAttributes();

            if ($isElement && $hasAttributes)
            {
                /** @var DOMNamedNodeMap $attrs */
                $attrs = $node->attributes;
                for ($j = 0; $j < $attrs->length; $j++)
                {
                    /** @var DOMAttr $attr */
                    $attr = $attrs->item($j);
                    if ($attr->namespaceURI == self::NS)
                    {
                        $attr->ownerElement->removeAttributeNode($attr);
                        $j--;
                    }
                }

                if ($node->tagName == 'input' && $node->getAttribute('type') == 'file')
                {
                    $hasFileInputs = true;
                }
            }
        }

        if ($hasFileInputs)
        {
            /** @var DOMElement $element */
            $element = $xml->firstChild->nextSibling;
            $element->setAttribute('enctype', 'multipart/form-data');
        }

        // Предотвращаем схлопывание пустых textarea
        $tags = $xml->getElementsByTagName('textarea');
        for ($i = 0; $i < $tags->length; $i++)
        {
            $node = $tags->item($i);
            $cdata = $xml->createCDATASection('');
            $node->appendChild($cdata);
        }

        $xml->formatOutput = true;
        $html = $xml->saveXML($xml->firstChild->nextSibling);
        // Удаляем атрибуты пространств имён
        $html = preg_replace('/\s*xmlns:\w+=("|\').*?("|\')/', '', $html);
        // Удаляем пустые <![CDATA[]]>
        $html = str_replace('<![CDATA[]]>', '', $html);

        return $html;
    }
1074057
public function generateTagCloud()
    {
        if ($this->tagCloud !== false) {
            return $this->tagCloud;
        }

        $this->tagCloud = $this->factory->buildTagCloud();

        $tags = $this->tagDataProvider->provideData();
        foreach ($tags as $tag => $source) {
            $tagObject = $this->factory->buildTag(
                $tag,
                count($source),
                $this->getPermalink($tag)
            );


            $this->tagCloud->addTag($tagObject);
        }

        $this->applyStrategies($this->tagCloud);

        return $this->tagCloud;
    }
760353
protected function getTitleTag()
    {
        $legend_tag = new SwatHtmlTag('legend');
        $legend_tag->setContent($this->title, $this->title_content_type);

        return $legend_tag;
    }
963161
public function withTag($tag) {
        if (is_null($this->tags)) {
            $this->tags = [];
        }

        array_push($this->tags, $tag);
        return $this;
    }
1100590
public function actionFollowerTag()
    {
        Yii::$app->response->format = Response::FORMAT_JSON;
        $tagId = Yii::$app->request->post('tag_id', null);
        if (($tag = Tag::findOne($tagId)) == null) {
            throw new NotFoundHttpException ();
        } else {
            /** @var \yuncms\user\models\User $user */
            $user = Yii::$app->user->identity;
            if ($user->hasTagValues($tag->id)) {
                $user->removeTagValues($tag->id);
                $user->save();
                return ['status' => 'unFollowed'];
            } else {
                $user->addTagValues($tag->id);
                $user->save();
                return ['status' => 'followed'];
            }
        }
    }
881661
protected function parseTags()
    {
        $token = $this->expectTokenType('Tag');
        $this->tags = array_merge($this->tags, $token['tags']);

        return $this->parseExpression();
    }
1199966
protected function getInsensitiveTag()
    {
        $tag = new SwatHtmlTag('span');

        $tag->id = $this->id;
        $tag->class = $this->getCSSClassString();

        if ($this->tooltip !== null) {
            $tag->title = $this->tooltip;
        }

        return $tag;
    }
348707
public function getTagHolderBackend() {
		if ($this->tagsBackend === null) {
			$this->tagsBackend = $this->getBackend();
		}
		
		return $this->tagsBackend;
	}
1271055
public function getCurrentTag() : string
    {
        $cmd    = new GetCurrentTag($this->repo->getRoot());
        $result = $this->runner->run($cmd);

        return trim($result->getStdOut());
    }
994548
protected function getInputTag()
    {
        $tag = parent::getInputTag();

        if ($this->name !== null) {
            $tag->name = $this->name;
        }

        return $tag;
    }
202366
public function openTag()
    {
        return '<form'.
               ' method="'.esc_attr($this->cfg->method).'"'.

               ($this->action
                    ? ' action="'.esc_url($this->s::restActionUrl($this->action)).'"'
                    : ' action="'.esc_url($this->cfg->action_url).'"'
               ).// NOTE: The `action` can also be empty.

               ' enctype="multipart/form-data"'.
               ' accept-charset="utf-8"'.
               ' autocomplete="off"'.
               '>';
    }
311856
public function getHTML()
    {
        // Открывающий тег
        $html = '<' . $this->tagName;

        /* Добавляем атрибуты */
        foreach ($this->attrs as $name => $value)
        {
            $html .= ' ' . $name;

            if ($value !== true)
            {
                $html .= '="' . $value . '"';
            }
        }

        $html .= '>';

        /* Если есть содержимое, то добавляем его и закрывающий тег */
        if ($this->contents !== null)
        {
            $html .= $this->contents . '</' . $this->tagName . '>';
        }

        return $html;
    }
1267573
public Object getTag() {
        Object result = null;
        if (view != null) {
            result = view.getTag();
        }
        return result;
    }
26378
public function getClosingTag(): ?string
    {
        if (!in_array($this->nodeName, self::SELF_CLOSING_TAGS)) {
            return sprintf('</%s>', $this->nodeName);
        }

        return null;
    }
484497
protected function getFormTag()
    {
        $form_tag = new SwatHtmlTag('form');

        $form_tag->addAttributes(array(
            'id' => $this->id,
            'method' => $this->method,
            'enctype' => $this->encoding_type,
            'accept-charset' => $this->accept_charset,
            'action' => $this->action,
            'class' => $this->getCSSClassString()
        ));

        // we're going to validate data on the server, so turn off HTML5
        // form validation
        $form_tag->novalidate = 'novalidate';

        return $form_tag;
    }