select2_box() html()
A searchable select on Select2 3.5 (jQuery).
html()->select2_box($name, $values = [], $selected = '', $extra = [])Options
| Option | Meaning |
|---|---|
$name, $values, $selected | Name; value => text; selected value(s). |
multiple, js_options, placeholder, class_add, force_id | Several values; Select2 options; empty text; classes; id. |
Example
Code
return html()->select2_box('input_name', ['k1' => 'key1', 'k2' => 'key2']);Notes
- Kept for existing pages; new code uses tom_select_box(), which needs no jQuery.
See also: form/select2_box, html/chosen_box, html/tom_select_box