• Модуль: ui
  • Путь к файлу: ~/bitrix/modules/ui/lib/buttons/basebutton.php
  • Класс: BitrixUIButtonsBaseButton
  • Вызов: BaseButton::render
public function render($jsInit = true)
{
	Extension::load($this->listExtensions());

	$output = '';
	$tagName = $this->getTag();
	$attributes = clone $this->getAttributeCollection();
	$this->appendDefaultJsonOption($attributes);

	switch ($tagName)
	{
		case Tag::LINK:
		case Tag::BUTTON:
			if ($tagName === Tag::LINK && $this->getLink())
			{
				$attributes['href'] = $this->getLink();
			}

			$inner = $this->renderInner();
			$output = "<{$tagName} {$attributes}>{$inner}";
			break;
		case Tag::INPUT:
		case Tag::SUBMIT:
			$attributes['value'] = htmlspecialcharsbx($this->getText());
			$attributes['type'] = Tag::BUTTON;

			if ($tagName === Tag::SUBMIT)
			{
				$tagName = Tag::INPUT;
				$attributes['type'] = Tag::SUBMIT;
			}

			$output = "<{$tagName} {$attributes}/>";
			break;
	}

	if ($jsInit)
	{
		$js = $this->renderJavascript();
		if ($js)
		{
			$output .= "";
		}
	}

	return $output;
}