PHP Class yii\bootstrap\ToggleButtonGroup

You can use this widget in an [[yii\bootstrap\ActiveForm|ActiveForm]] using the [[yii\widgets\ActiveField::widget()|widget()]] method, for example like this: php field($model, 'item_id')->widget(\yii\bootstrap\ToggleButtonGroup::classname(), [ configure additional widget properties here ]) ?>
See also: http://getbootstrap.com/javascript/#buttons-checkbox-radio
Since: 2.0.6
Author: Paul Klimov ([email protected])
Inheritance: extends InputWidget
Afficher le fichier Open project: yiisoft/yii2-bootstrap

Méthodes publiques

Свойство Type Description
$encodeLabels whether the items labels should be HTML-encoded.
$items the data item used to generate the checkboxes. The array values are the labels, while the array keys are the corresponding checkbox or radio values.
$labelOptions
$type input type, can be: - 'checkbox' - 'radio'

Méthodes publiques

Méthode Description
init ( )
renderItem ( integer $index, string $label, string $name, boolean $checked, string $value ) : string Default callback for checkbox/radio list item rendering.
run ( )

Method Details

init() public méthode

public init ( )

renderItem() public méthode

Default callback for checkbox/radio list item rendering.
See also: Html::checkbox()
See also: Html::radio()
public renderItem ( integer $index, string $label, string $name, boolean $checked, string $value ) : string
$index integer item index.
$label string item label.
$name string input name.
$checked boolean whether value is checked or not.
$value string input value.
Résultat string generated HTML.

run() public méthode

public run ( )

Property Details

$encodeLabels public_oe property

whether the items labels should be HTML-encoded.
public $encodeLabels

$items public_oe property

the data item used to generate the checkboxes. The array values are the labels, while the array keys are the corresponding checkbox or radio values.
public $items

$labelOptions public_oe property

See also: Html::checkbox()
See also: Html::radio()
public $labelOptions

$type public_oe property

input type, can be: - 'checkbox' - 'radio'
public $type