div_box() html()
A Bootstrap dropdown that sets a hidden input: the choice shows on the toggle.
html()->div_box($name, $values = [], $selected = '', $extra = [])Опції
| Опція | Значення |
|---|---|
$name, $values, $selected | Name; value => text; selected value. |
class_add, id, text | Classes; id; text of the toggle without a selection. |
Приклад
Код
return html()->div_box('input_name', ['k1' => 'key1', 'k2' => 'key2'], 'k2');Примітки
- Needs JavaScript to change the value; select_box() works without.
Bootstrap 3 and 5
Bootstrap 5 renders dropdown-menu markup with data-bs-toggle.
Див. також: html/button_box, html/list_box, form/div_box