Create a single Bootstrap radio input.

@param  string  $name
@param  string  $label
@param  string  $value
@param  bool    $checked
@param  bool    $inline
@param  array   $options
@return string
10721
public function radioElement($name, $label = null, $value = null, $checked = null, $inline = false, array $options = [])
    {
        $label = $label === false ? null : $this->getLabelTitle($label, $name);

        $value = is_null($value) ? $label : $value;

        $labelOptions = $inline ? ['class' => 'radio-inline'] : [];

        $inputElement = $this->form->radio($name, $value, $checked, $options);
        $labelElement = '<label ' . $this->html->attributes($labelOptions) . '>' . $inputElement . $label . '</label>';

        return $inline ? $labelElement : '<div class="radio">' . $labelElement . '</div>';
    }
34008
protected function getRadioCheckedState($name, $value, $checked)
    {
        if ($this->missingOldAndModel($name)) return $checked;

        return $this->getValueAttribute($name) == $value;
    }
148587
public static function label( $name, $label, $help = '', $options = null ) {

		if ( is_array( $label ) || is_object( $label ) ) {
			$options = $label;
			$label   = $options['label'];

			if ( empty( $label ) ) {
				$label = ucwords( str_replace( '_', ' ', $name ) );
			}

			$help = $options['help'];
		} else {
			$options = self::options( null, $options );
		}

		$label = apply_filters( 'pods_form_ui_label_text', $label, $name, $help, $options );
		$help  = apply_filters( 'pods_form_ui_label_help', $help, $name, $label, $options );

		ob_start();

		$name_clean      = self::clean( $name );
		$name_more_clean = self::clean( $name, true );

		$type                = 'label';
		$attributes          = array();
		$attributes['class'] = 'pods-form-ui-' . $type . ' pods-form-ui-' . $type . '-' . $name_more_clean;
		$attributes['for']   = ( false === strpos( $name_clean, 'pods-form-ui-' ) ? 'pods-form-ui-' : '' ) . $name_clean;
		$attributes          = self::merge_attributes( $attributes, $name, $type, $options, false );

		pods_view( PODS_DIR . 'ui/fields/_label.php', compact( array_keys( get_defined_vars() ) ) );

		$output = ob_get_clean();

		return apply_filters( "pods_form_ui_{$type}", $output, $name, $label, $help, $attributes, $options );
	}
128608
public function label($name, $label, array $attr = null)
    {
        return $this->input($name, [ 'type' => 'label', 'label' => $label, 'attr' => $attr ]);
    }
769226
protected function renderDefault($name, $value, $options)
    {
        $type = $this->type;

        if (method_exists('yii\helpers\Html', $type)) {
            $options['tabindex'] = self::TABINDEX;

            if ($this->renderer->isBootstrapTheme()) {
                Html::addCssClass($options, 'form-control');
            }

            $input = Html::$type($name, $value, $options);
        } elseif (class_exists($type) && method_exists($type, 'widget')) {
            $input = $this->renderWidget($type, $name, $value, $options);
        } else {
            throw new InvalidConfigException("Invalid column type '$type'");
        }

        return $input;
    }
1081721
private function setFormFieldLabel($name, $options)
    {
        if (isset($options['label']) && $options['label'] != false) {
            $label = isset($options['label']) ? $options['label'] : $this->formatFieldLabel($name);

            return FormFacade::label($name, $label, ['class' => 'form-label']).'&nbsp;';
        } elseif (!isset($options['label'])) {
            return FormFacade::label($name, $this->formatFieldLabel($name), ['class' => 'form-label']).'&nbsp;';
        }
    }
1068155
private static function select_option($label, $value, array $selected) {
        $attributes = array();
        $value = (string)$value;
        if (in_array($value, $selected, true)) {
            $attributes['selected'] = 'selected';
        }
        $attributes['value'] = $value;
        return self::tag('option', $label, $attributes);
    }
536757
public static function select($name,
                           $class,
                           $id,
                           array $options,
                           $opt_value = NULL,
                           $label = NULL,
                           $attrs = array())
    {
        $attrs['name'] = $name;
        
        $opts = array();
        foreach($options as $value => $msg)
        {
            $opt_attr = array(
              'value' => $value 
            );
            
            if(($opt_value) && $value == $opt_value)
                $opt_attr['selected'] = 'selected';
            
            $opts[] = self::tag('option', $msg, NULL, NULL, $opt_attr);
            
        }
        
        $opts = self::parseBreak(implode(PHP_EOL, $opts));
        $ret = NULL;
        if($label)
            $ret = PHP_EOL . self::formatLabel($label, $id);
            
        $ret .= self::parseBreak(self::tag('select', $opts, $class, $id, $attrs));
        return $ret;
    }
1264587
public function checkbox($name, $value = 1, $label = null, $checked = null, $options = array())
    {
        if ($this->hasErrors($name)) {
            $options = $this->appendClassToOptions('is-invalid', $options);
        }

        $checkable = parent::checkbox($name, $value, $checked, $options);

        return $this->wrapCheckable($label, 'checkbox', $checkable);
    }
696326
public static function checkBox($name, $checked = false, $htmlOptions = array())
    {
        $label = TbArray::popValue('label', $htmlOptions, false);
        $labelOptions = TbArray::popValue('labelOptions', $htmlOptions, array());
        self::addCssClass('checkbox', $labelOptions);
        $input = parent::checkBox($name, $checked, $htmlOptions);
        return self::createCheckBoxAndRadioButtonLabel($label, $input, $labelOptions);
    }
1119876
protected function display_category_form_checkbox($name, $value, $label) {
        debugging('display_category_form_checkbox() is deprecated, ' .
                'please use \core_question\bank\search\condition instead.', DEBUG_DEVELOPER);
        echo '<div><input type="hidden" id="' . $name . '_off" name="' . $name . '" value="0" />';
        echo '<input type="checkbox" id="' . $name . '_on" name="' . $name . '" value="1"';
        if ($value) {
            echo ' checked="checked"';
        }
        echo ' onchange="getElementById(\'displayoptions\').submit(); return true;" />';
        echo '<label for="' . $name . '_on">' . $label . '</label>';
        echo "</div>\n";
    }
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>' );
	}
915181
public function radios($name, $radioOptions, $options = [])
    {
        $requiredClass = (isset($options['required']) && $options['required'] == true) ? 'required ' : '';
        $hasError = $this->errorBag->has($this->formatArrayName($name));
        $hasErrorClass = $hasError ? 'has-error' : '';

        $htmlForm = '<div class="form-group '.$requiredClass.$hasErrorClass.'">';
        $htmlForm .= $this->setFormFieldLabel($name, $options);
        $htmlForm .= '<div>';

        foreach ($radioOptions as $key => $option) {
            $value = null;
            $fieldParams = ['id' => $name.'_'.$key, 'class' => 'form-check-input'];

            if (isset($options['value']) && $options['value'] == $key) {
                $value = true;
            }
            if (isset($options['v-model'])) {
                $fieldParams += ['v-model' => $options['v-model']];
            }
            if (isset($options['required']) && $options['required'] == true) {
                $fieldParams += ['required' => true];
            }
            if ($hasError) {
                $fieldParams['class'] .= ' is-invalid';
            }

            $listStyle = isset($options['list_style']) ? $options['list_style'] : 'form-check-inline';
            $htmlForm .= '<div class="form-check '.$listStyle.'">';
            $htmlForm .= FormFacade::radio($name, $key, $value, $fieldParams);
            $htmlForm .= '<label for="'.$name.'_'.$key.'" class="form-check-label">'.$option.'</label>';
            $htmlForm .= '</div>';
        }
        $htmlForm .= '</div>';

        $htmlForm .= $this->getInfoTextLine($options);

        $htmlForm .= $this->errorBag->first($this->formatArrayName($name), '<span class="small text-danger" role="alert">:message</span>');

        $htmlForm .= '</div>';

        return $htmlForm;
    }
931945
public function checkbox($name = null, $checked = false, $value = '1')
    {
        return $this->input('checkbox', $name, $value)
            ->attributeIf(! is_null($value), 'value', $value)
            ->attributeIf((bool) $this->old($name, $checked), 'checked');
    }
1340566
public static function checkLabel( $label, $name, $id, $checked = false, $attribs = array() ) {
		return self::check( $name, $checked, array( 'id' => $id ) + $attribs ) .
			   '&#160;' .
			   self::label( $label, $id, $attribs );
	}
942134
private static function buildWrapper($field, $name, $label = '', $checkbox = false, $required)
        {
            $getter = 'get' . Inflector::camelize($name);
            $error = null;
            $actual = Session::instance('ThinForm')->getActual();

            if (null !== $actual) {
                $error = $actual->getErrors()->$getter();
            }

            $class = 'control-group';

            if (!empty(static::$controlGroupError) && !empty($error)) {
                $class .= ' ' . static::$controlGroupError;
            }

            $id = ' id="control-group-' . $name . '"';
            $out = '<div class="' . $class . '"' . $id . '>';
            $out .= static::buildLabel($name, $label, $required);
            $out .= '<div class="controls">' . PHP_EOL;
            $out .= ($checkbox === true) ? '<label class="checkbox">' : '';
            $out .= $field;

            if (!empty($error)) {
                $out .= '<span class="help-inline">' . $error . '</span>';
            }

            $out .= ($checkbox === true) ? '</label>' : '';
            $out .= '</div>';
            $out .= '</div>' . PHP_EOL;

            return $out;
        }
936414
public static function checkboxSmart($name, $checked = false, $options = [])
    {
        $options['checked'] = (boolean)$checked;
        $value = array_key_exists('value', $options) ? $options['value'] : '1';
        if (isset($options['uncheck'])) {
            // add a hidden field so that if the checkbox is not selected, it still submits a value
            $hidden = static::hiddenInput($name, $options['uncheck']);
            unset($options['uncheck']);
        } else {
            $hidden = '';
        }
        if (isset($options['label'])) {
            $label = $options['label'];
            $labelOptions = isset($options['labelOptions']) ? $options['labelOptions'] : [];
            unset($options['label'], $options['labelOptions']);
            $iconOptions = ArrayHelper::remove($options, 'iconOptions', []);
            $iconTag = ArrayHelper::remove($iconOptions, 'tag', 'i');
            $content = static::label(static::input('checkbox', $name, $value, $options) . Html::tag($iconTag, null, $iconOptions) . $label, null, $labelOptions);
            return $hidden . $content;
        } else {
            return $hidden . static::input('checkbox', $name, $value, $options);
        }
    }