Creates a Bootstrap label with $message and optionally the $type. Any
options that could get passed to HtmlHelper::tag can be passed in the
third param.

@param  string $text
@param  string $contextual
@param  array  $options
@return string
323108
public function label($text, $contextual = '', array $options = [])
    {
        $class = $prefix = 'label';

        if (isset($options['icon'])) {
            $content = $this->_icon($text, $options);
            unset($options['icon']);
        } else {
            $content = $text;
        }
        if (!empty($contextual)) {
            $class .= " $prefix-$contextual";
        }
        $classes = $class;
        if (isset($options['class']) && !empty($options['class'])) {
            $classes .= " " . $options['class'];
        }
        $options['class'] = $classes;
        return parent::tag('span', $content, $options);
    }
132856
private function createLabel(string $text, string $name): Markup
    {
        return HtmlTag::createElement('label')
            ->set('for', $name)
            ->text($text);
    }
821592
public static function badgeLabel($content, $options = [])
    {
        static::addCssClass($options, 'label');
        $color = ArrayHelper::remove($options, 'color', static::LABEL_DEFAULT);
        static::addCssClass($options, $color);
        return static::tag(ArrayHelper::remove($options, 'tag', 'span'), $content, $options);
    }
1109924
public function addCustomScriptLabel($name, $text = null)
    {
        if ($name instanceof ScriptLabel) {
            $scriptLabel = $name;
        } else {
            $scriptLabel = new ScriptLabel($name, $text);
        }
        if (!in_array($scriptLabel, $this->customLabels)) {
            array_push($this->customLabels, $scriptLabel);
        }
        return $this;
    }
564352
public function message($type = null)
    {
        switch ($type) {
            case static::MESSAGE_HTML:
                return $this->_htmlMessage;
            case static::MESSAGE_TEXT:
                return $this->_textMessage;
        }

        return $this->_message;
    }
385248
public static function validText(
        $msg = '',
        $options = [],
        $default = null,
        $noValidMessage = null,
        $attemptTimes = 3,
        $failCloseMessage = false
    ) {
        $prompter = new ValidatePrompter();

        $prompter->setOptions($options);

        static::prepareCallbackPrompter($prompter, $noValidMessage, $attemptTimes, $failCloseMessage);

        return $prompter->ask($msg, $default);
    }
303041
public static function label($input, $text, array $attributes = null)
    {
        // Set the label target
        $attributes['for'] = $input;

        return '<label'.Html::attributes($attributes).'>'.$text.'</label>';
    }
667188
public function _message($type, $message)
    {
        $context = $this->_context;

        $cssClasses = isset($this->_cssClasses[$type]) ? $this->_cssClasses[$type] : '';

        $context->messages[] = '<div class="' . $cssClasses . '">' . $message . '</div>' . PHP_EOL;
    }
131195
public function badge($text, $options = [])
    {
        $defaults = array_merge(['class' => 'badge'], $options);
        return parent::tag('span', $text, $defaults);
    }
7137
public function addLabel($text, $isPlain = true, $lang = 'en')
    {
        $this->labels[$lang] = new Label($text, $this->getLocaleKey(), $isPlain, $lang, $this->name);
    }
105256
public function label( $name, $value = null, $options = [] ) {
		$this->labels[] = $name;

		$value = $this->format_label( $name, $value );

		return $this->to_html_string( '<label for="' . $name . '"' . $this->attributes( $options ) . '>' . $value . '</label>' );
	}
429066
public function toastr(string $type, string $message = '', string $title = '', string $options = ''): string
    {
        return "toastr.$type('$message', '$title', $options);";
    }
731613
public function message($message, $options = null) {
		$options = $this->_mergeOptions($options);
		$options['message'] = $message;

		return $this->_View->element($options['element'], $options);
	}
1141255
private function labeledMessage($label, $message, $options = 0)
    {
        if (isset($this->stdErr)) {
            $this->stdErr->writeln('<options=reverse>' . strtoupper($label) . '</> ' . $message, $options);
        }
    }
1269646
public function text($name, $value = null, array $options = [])
    {
        return $this->form->text($name,
                                 $value,
                                 $this->addFormControlClass($this->getFieldOptions($name, $options)));
    }
76066
public function label($name, $value = null, array $options = [])
    {
        $options = $this->getLabelOptions($options);

        $escapeHtml = false;

        if (is_array($value) and isset($value['html'])) {
            $value = $value['html'];
        } elseif ($value instanceof HtmlString) {
            $value = $value->toHtml();
        } else {
            $escapeHtml = true;
        }

        return $this->form->label($name, $value, $options, $escapeHtml);
    }
365898
protected static function createCheckBoxAndRadioButtonLabel($label, $input, $htmlOptions)
    {
        list ($hidden, $input) = self::normalizeCheckBoxAndRadio($input);
        return $hidden . ($label !== false
            ? self::tag('label', $htmlOptions, $input . ' ' . $label)
            : $input);
    }