button_radio_box(), button_check_box() html()
Radios or check boxes drawn as a group of toggle buttons.
html()->button_radio_box($name, $values = [], $selected = null, $extra = [])
html()->button_check_box($name, $values = [], $selected = '')Опції
| Опція | Значення |
|---|---|
$name, $values, $selected | Name; value => label; selected value(s). |
label_extra | button_radio_box(): attributes of the labels (['class' => 'btn btn-outline-primary']). |
Приклад
Код
return '<p>' . html()->button_radio_box('view', ['k1' => 'key1', 'k2' => 'key2'], 'k1') . '</p>'
. '<p>' . html()->button_check_box('show', ['k1' => 'key1', 'k2' => 'key2']) . '</p>';Bootstrap 3 and 5
Bootstrap 3 data-toggle="buttons"; Bootstrap 5 btn-check inputs with btn labels.
Див. також: form/button_radio_box, html/button_yes_no_box