Returns the formatted button
@return string the resulting HTML
482047
public function renderButtons()
    {
        list($name, $id) = $this->resolveNameID();
        $buttons   = array();
        $checked   = $this->hasModel() ? (!$this->model->{$this->attribute}) : true;
        $buttons[] = \CHtml::radioButton($name, $checked, array('id' => $id . '_on', 'value' => 1));
        $buttons[] = \CHtml::label($this->offLabel, $id . '_on');
        $checked   = $checked ? false : true;
        $buttons[] = \CHtml::radioButton($name, $checked, array('id' => $id . '_off', 'value' => 1));
        $buttons[] = \CHtml::label($this->onLabel, $id . '_off');
        $buttons[] = '<span></span>';

        return \CHtml::tag('div', $this->htmlOptions, implode("\n", $buttons));
    }
1347515
protected function render(): string
    {
        switch ($this->mode) {
            case 'button':
                $html = '<button class="btn' . $this->classes() . '" type="submit"' .
                    (($this->disabled === true) ? ' disabled' : null) .
                    '>' . $this->label . '</button>';
                break;

            case 'input':
                $html = '<input class="btn' . $this->classes() . '" type="' .
                    $this->input_type . '" value="' .
                    $this->label . '" ' .
                    (($this->disabled === true) ? ' disabled ' : null) . '/>';
                break;

            default:
                $html = '<a href="' . (($this->uri !== null) ? $this->uri : '#') .
                    '" class="btn' . $this->classes() .
                    (($this->disabled === true) ? ' disabled' : null) .
                    '" role="button">' . $this->label . '</a>';
                break;
        }

        return $html;
    }
412638
public function getHtml(): string
  {
    $this->attributes['name'] = $this->submitName;

    $html = $this->prefix;
    $html .= $this->getHtmlPrefixLabel();
    $html .= Html::generateElement('textarea', $this->attributes, Cast::toOptString($this->value));
    $html .= $this->getHtmlPostfixLabel();
    $html .= $this->postfix;

    return $html;
  }
201031
protected function buttonLabel()
    {
        if (!empty($this->buttonLabel) && is_string($this->buttonLabel)) {
            return $this->buttonLabel;
        }
        return $this->bootstrapDefaults['buttonLabel'];
    }
62051
public function render()
	{
		$attributes	= $this->getAttributes();
		$attributes['onclick']	= 'location.href=\''.ADT_URL_Inference::buildStatic( $this->parameters ).'\';';
		return UI_HTML_Tag::create( 'button', $this->content, $attributes );
	}
91320
public function getHTML()
    {
        $html = '';
        switch (arg('action'))
        {
            case 'add':
                $html = $this->actionAddDialog();
                break;

            case 'create':
                $html = $this->actionCreate();
                break;

            default:

                switch (true)
                {
                    case arg('edit'):
                        $html = $this->actionEditDialog(arg('edit'));
                        break;

                    case arg('update'):
                        $html = $this->actionUpdate();
                        break;

                    case arg('delete'):
                        $this->actionDelete(arg('delete'));
                        break;

                    default:
                        $html = $this->actionIndex();
                }
                break;
        }
        return $html;
    }
1228341
public function renderHeader()
    {
        if (!$this->isAddButtonPositionHeader()) {
            return '';
        }

        $options = ['class' => 'list-cell__button'];
        $layoutConfig = array_merge([
            'buttonAddClass' => $this->isBootstrapTheme() ? 'col-sm-offset-9 col-sm-3' : '',
        ], $this->layoutConfig);
        Html::addCssClass($options, $layoutConfig['buttonAddClass']);

        return Html::tag('div', $this->renderAddButton(), $options);
    }
604713
public function renderButton()
	{
		try {
			// Renderer function may be used
			return $this->useRenderer();
		} catch (DataGridColumnRendererException $e) {
			// Do not use renderer
		}

		$link = $this->createLink($this->grid, $this->href, $this->params);

		$a = Html::el('a')->href($link);

		$this->tryAddIcon($a, $this->getIcon(), $this->getText());

		if (!empty($this->attributes)) {
			$a->addAttributes($this->attributes);
		}

		$a->addText($this->grid->getTranslator()->translate($this->text));

		if ($this->getTitle()) {
			$a->title($this->grid->getTranslator()->translate($this->getTitle()));
		}

		if ($this->getClass()) {
			$a->class($this->getClass());
		}

		return $a;
	}
1079940
public function getClickedButton()
    {
        if ($this->clickedButton) {
            return $this->clickedButton;
        }

        if ($this->parent && method_exists($this->parent, 'getClickedButton')) {
            return $this->parent->getClickedButton();
        }
    }
1338248
public function render()
    {
        if ($this->closable) {
            $this->createDismissButton();
        }

        $this->getElement()->setAppendContent();

        return $this->getElement()->render();
    }
342672
public function getButtonAttributes()
    {
        $attributes = [
            'type' => 'button',
            'class' => $this->ButtonClass,
            'title' => $this->ButtonLabel,
            'aria-label' => $this->ButtonLabel,
            'aria-expanded' => 'false',
            'aria-controls' => $this->CollapseHTMLID,
            'data-target' => $this->CollapseCSSID,
            'data-toggle' => 'collapse'
        ];
        
        $this->extend('updateButtonAttributes', $attributes);
        
        return $attributes;
    }
557829
public function getMethod()
    {
        if (null !== $this->method) {
            return $this->method;
        }

        // If the form was created from a button rather than the form node, check for HTML5 method override
        if ($this->button !== $this->node && $this->button->getAttribute('formmethod')) {
            return strtoupper($this->button->getAttribute('formmethod'));
        }

        return $this->node->getAttribute('method') ? strtoupper($this->node->getAttribute('method')) : 'GET';
    }
178264
public function renderHeader()
    {
        if ($this->min !== 0 || !$this->isAddButtonPositionHeader()) {
            return '';
        }

        $button = $this->isAddButtonPositionHeader() ? $this->renderAddButton() : '';

        $content = [];
        $content[] = Html::tag('td', '&nbsp;');

        if ($this->cloneButton) {
            $content[] = Html::tag('td', '&nbsp;');
        }

        $content[] = Html::tag('td', $button, [
            'class' => 'list-cell__button',
        ]);

        return Html::tag('thead', Html::tag('tr', implode("\n", $content)));
    }
420077
public function getHtml(): string
  {
    $html = $this->prefix;
    $html .= Html::generateTag('span', $this->attributes);

    if (is_array($this->options))
    {
      foreach ($this->options as $option)
      {
        $inputAttributes = $this->inputAttributes($option);
        $labelAttributes = $this->labelAttributes($option);

        $labelAttributes['for'] = $inputAttributes['id'];

        // Get the (database) key of the option.
        $key  = $option[$this->keyKey];

        // If an obfuscator is installed compute the obfuscated code of the (database) ID.
        $code = ($this->optionsObfuscator) ? $this->optionsObfuscator->encode(Cast::toOptInt($key)) : $key;

        $inputAttributes['name']    = ($this->submitName!=='') ? $this->submitName.'['.$code.']' : $code;
        $inputAttributes['checked'] = ($this->checkedKey!==null && !empty($option[$this->checkedKey]));

        $html .= Html::generateVoidElement('input', $inputAttributes);

        $html .= $this->labelPrefix;
        $html .= Html::generateElement('label',
                                       $labelAttributes,
                                       Cast::toOptString($option[$this->labelKey]),
                                       $this->labelIsHtml);
        $html .= $this->labelPostfix;
      }
    }

    $html .= '</span>';
    $html .= $this->postfix;

    return $html;
  }
1048574
private function get_subscription_button_html() : string {
        global $PAGE;

        $forumrecord = $this->forumrecord;
        $discussion = $this->discussion;
        $html = html_writer::div(
            forum_get_discussion_subscription_icon($forumrecord, $discussion->get_id(), null, true),
            'discussionsubscription'
        );
        $html .= forum_get_discussion_subscription_icon_preloaders();
        // Add the subscription toggle JS.
        $PAGE->requires->yui_module('moodle-mod_forum-subscriptiontoggle', 'Y.M.mod_forum.subscriptiontoggle.init');
        return $html;
    }
148938
protected function renderButtons()
    {
        $buttons = [];
        foreach ($this->buttons as $button) {
            if (is_array($button)) {
                $button['view'] = $this->getView();
                $button['defaultClass'] = false;
                if (!isset($button['encodeLabel'])) {
                    $button['encodeLabel'] = $this->encodeLabels;
                }
                $buttons[] = Html::tag('li', Button::widget($button));
            } else {
                $buttons[] = Html::tag('li', $button);
            }
        }

        return implode("\n", $buttons);
    }
471709
public function __toHtml()
    {
        return $this->toHtml($submitted = false, $blnSimpleLayout = false, $blnLabel = true, $blnDisplayError = true);
    }