accordion() html()
An accordion: one collapsible item per array entry, title => body.
html()->accordion($data = [], $extra = [])Опції
| Опція | Значення |
|---|---|
$data | Title => body (developer HTML), or title => ['body', 'class_group', 'class_head']. |
selected | Title of the open item. |
class, class_head, id | Classes of the whole and of the headers; id. |
flush, always_open, theme | Bootstrap 5: no borders; items open independently (no data-parent); data-bs-theme. |
Приклад
Код
return html()->accordion([
'first' => ['body' => 'first accordion item body', 'class_group' => 'panel-info', 'class_head' => 'alert-info'],
'second' => ['body' => 'second accordion item body', 'class_group' => 'panel-danger', 'class_head' => 'alert-error'],
'third' => 'Open on load: <code>selected</code> names it.',
'fourth' => 'fourth accordion item body',
], ['selected' => 'third', 'class' => 'span4 col-md-4']);Примітки
- Item bodies have ids
accordion_item_<title>; opening one closes the others unlessalways_open.
Bootstrap 3 and 5
Bootstrap 3 collapse panels; Bootstrap 5 accordion-item markup.
Див. також: html/collapse, html/tabs