Create an addon button element.

@param  string  $label
@param  array  $options
@return string
432041
public function addonButton($label, $options = [])
    {
        $attributes = array_merge(['class' => 'btn', 'type' => 'button'], $options);

        if (isset($options['class'])) {
            $attributes['class'] .= ' btn';
        }

        return '<div class="input-group-btn"><button ' . $this->html->attributes($attributes) . '>'.$label.'</button></div>';
    }
760373
protected static function btnDropdown($type, $label, $items, $htmlOptions)
    {
        $menuOptions = TbArray::popValue('menuOptions', $htmlOptions, array());
        $groupOptions = TbArray::popValue('groupOptions', $htmlOptions, array());
        self::addCssClass('btn-group', $groupOptions);
        if (TbArray::popValue('dropup', $htmlOptions, false)) {
            self::addCssClass('dropup', $groupOptions);
        }
        $output = self::openTag('div', $groupOptions);
        $toggleButtonType = TbArray::popValue('type', $htmlOptions, self::BUTTON_TYPE_HTML);
        $toggleButtonType = is_array($toggleButtonType) ? $toggleButtonType[1] : $toggleButtonType;
        if (TbArray::popValue('split', $htmlOptions, false)) {
            $output .= self::createButton($type, $label, $htmlOptions);
            $label = '';
        }        
        if(in_array($toggleButtonType, array(self::BUTTON_TYPE_LINKBUTTON, self::BUTTON_TYPE_LINK))){
            $output .= self::dropdownToggleLink($label, $htmlOptions);       
        } else {
            $output .= self::dropdownToggleButton($label, $htmlOptions);
        }
        $output .= self::dropdown($items, $menuOptions);
        $output .= '</div>';
        return $output;
    }
661338
public function resetLink($label, array $options = [])
    {
        return $this->Html->link($label, $this->resetUrl(), $options);
    }
420532
public static function renderOption($value, $label, $selected, $options = [])
    {
        if ($value === true) {
            // Handle the special case of a true value
            $value = "true";
        }
        $options = array_merge($options, ["value" => $value]);
        if ($selected) {
            $options['selected'] = true;
        }

        return sprintf("<option %s>%s</option>", html_params($options), $label);
    }
239768
public function addButton($label = 'Continue')
    {
        if (!is_array($label)) {
            $label = array($label, 'icon-r' => 'right-big');
        }

        /** @type Button $button */
        $button = $this->add('Button', null, 'Button');

        return $button->set($label);
    }
1359230
public static function make($name, $label = '')
    {
        return parent::make($name, $label)->separator(',')->options(
            Options::make()->append('', 1)
        );
    }
1058650
public function addFields($fields=NULL, $label=NULL) {
		if (isset($fields)) {
			if (!$fields instanceof HtmlFormFields) {
				if (!\is_array($fields)) {
					$fields=\func_get_args();
					$end=\end($fields);
					if (\is_string($end)) {
						$label=$end;
						\array_pop($fields);
					} else
						$label=NULL;
				}
				$this->_fields=\array_merge($this->_fields, $fields);
				$fields=new HtmlFormFields("fields-" . $this->identifier . "-" . $this->count(), $fields);
			}
			if (isset($label)){
				$fields->wrap("<div class='field'><label>{$label}</label>","</div>");
			}
		} else {
			$fields=new HtmlFormFields("fields-" . $this->identifier . "-" . $this->count());
		}
		$this->addItem($fields);
		return $fields;
	}
512558
protected function generateCheckboxByGroup($id, $label, $name, $checked, array $options)
    {
        $identifier = \sprintf('%s_%s', $name, $id);
        $key = \sprintf('%s[]', $name);
        $active = \in_array($id, (array) $checked);

        $options['id'] = $identifier;

        $control = $this->checkbox($key, $id, $active, $options);

        $label = $this->label($identifier, $label);

        return \implode(' ', [$control, $label]);
    }
923355
public static function buttonDropdown($label, $items, $htmlOptions = array())
    {
        $htmlOptions['items'] = $items;
        $type = isset($htmlOptions['type']) ? $htmlOptions['type'] : self::BUTTON_TYPE_SUBMIT;
        $type = is_array($type) ? $type[0] : $type;
        return self::btn($type, $label, $htmlOptions);
    }
407060
public function addText($name, $label = '', $is_mandatory = true)
    {
        $e = new \FrenchFrogs\Form\Element\Text($name, $label);
        $this->addElement($e);

        if ($is_mandatory) {
            $e->addRule('required');
        } else {
            $e->addFilter('nullable');
        }

        return $e;
    }
813146
public static function menuHeader($label, $htmlOptions = array())
    {
        self::addCssClass('dropdown-header', $htmlOptions);
        return self::tag('li', $htmlOptions, $label);
    }
921102
public function editButton(EntityInterface $entity, array $options = []): string
    {
        $options = Hash::merge([
            'url' => null,
            'title' => __d('ck_tools', 'edit'),
            'icon' => 'fa fa-pencil',
            'escape' => false,
            'class' => 'btn btn-default btn-xs btn-edit',
        ], $options);

        $url = $options['url'];
        $title = $options['title'];
        $icon = $options['icon'];
        unset($options['url'], $options['title'], $options['icon']);
        if (!$url) {
            // phpcs:ignore
            list($plugin, $controller) = pluginSplit($entity->source());
            $url = [
                'plugin' => $this->_View->request->plugin,
                'controller' => $controller,
                'action' => 'edit',
                $entity->id,
            ];
            $url = $this->augmentUrlByBackParam($url);
        }
        if ($icon) {
            $title = '<i class="' . $icon . '"></i> ' . '<span class="button-text">' . $title . '</span>';
            $options['escape'] = false;
        }

        return $this->Html->link($title, $url, $options);
    }
1231824
public function addButton($label = null, $options = array())
    {
        /** @type Button $but */
        $but = $this->add('Button', $options);
        $but->set($label);
        if ($this->vertical) {
            $but->js(true)->css('margin-top', '-3px');
        }

        return $but;
    }
1044011
private function get_add_element_content($label) {
        global $PAGE, $OUTPUT;

        $bs4 = false;

        $theme = $PAGE->theme;
        if ($theme->name === 'boost') {
            $bs4 = true;
        } else {
            foreach ($theme->parents as $basetheme) {
                if ($basetheme === 'boost') {
                    $bs4 = true;
                }
            }
        }

        if (!$bs4) {
            return $label;
        }
        return $OUTPUT->pix_icon('e/insert', $label);
    }
1165443
public static function createDropdown($label, array $attributes = array(), $fromFieldset = false)
    {
        $dropdown = new Dropdown();
        $dropdown->setLabel($label);

        static::applyAttributes($dropdown, $attributes, $fromFieldset);

        return $dropdown;
    }
701452
public function createButton($label, array $attributes = [])
    {
        $button = new Components\Form\Elements\Button($label);

        if ( ! array_key_exists('class', $attributes)) {
            $button->attributes->addAttributeClass(['btn', 'my-2', 'my-sm-0']);
        }

        if (count($attributes)) {
            foreach ($attributes as $name => $value) {
                $button->attributes->addAttribute($name, $value);
            }
        }

        $this->childNodes->push($button);

        return $this->childNodes->last();
    }
885287
public function renderItem($label, $options = array())
    {
        if ($this->tagName === 'nav') {
            $url         = ArrayHelper::removeValue($options, 'href', '#');
            $htmlOptions = ArrayHelper::removeValue($options, 'options', array());
            echo \CHtml::openTag('li', $htmlOptions);
            echo \CHtml::link($label, $url);
            echo \CHtml::closeTag('li');
        } else {
            $htmlOptions = ArrayHelper::removeValue($options, 'options', array());
            echo \CHtml::tag('a', array_merge($htmlOptions, $options), $label);
        }
    }