Цю сторінку ще не перекладено українською, тому нижче англійська версія.

tabs() html()

Tabs: one tab per array item, title => content.

html()->tabs($tabs = [], $extra = [])

Опції

ОпціяЗначення
$tabsTitle => content (developer HTML), or title => ['body' => ..., 'disabled' => 1].
selectedTitle of the open tab; default the first.
class, id, show_all, no_headersClasses; id; show every pane (print views); no tab headers.
type, fill, justified, verticalBootstrap 5: tabs, pills, underline; fill or justify the nav; vertical pills.

Приклад

first text
second text

Third tab, open on load: selected names it.

44444

Код

return html()->tabs([
    'first' => 'first text',
    'second' => 'second text',
    'third' => '<p>Third tab, open on load: <code>selected</code> names it.</p>',
    'fourth' => '44444',
], ['selected' => 'third']);

Примітки

  • Pane ids are tab_<title>, so links to #tab_third open that tab. form2 builds its tabs with this widget (tab_start()).

Bootstrap 3 and 5

Bootstrap 3 tabs; Bootstrap 5 uses nav-link + data-bs-toggle and the type / fill / vertical options.

Див. також: form/tab, html/accordion, demo:html/bs5_options