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
Show file Open project: yiisoft/yii2-bootstrap

Public Properties

Property 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'

Public Methods

Method 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 method

public init ( )

renderItem() public method

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.
return string generated HTML.

run() public method

public run ( )

Property Details

$encodeLabels public property

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

$items public 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 property

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

$type public property

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