Renderer of the switchable tab element. Inherits from Jet\UI_Renderer_Pair.

Each tab is represented by its own Jet\UI_tabsJs_tab renderer..

Each tab must have its own ID and title.

Ussage: $tabs UI::tabsJS'create_menu_item_target_tabs', [
'tab_direct_mvc'  => Tr::_'MVC link' ),
'tab_direct_link' => Tr::_'Direct link' ),
<?= $tabs
->start() ?>

    <?= $tabs->tab'tab_direct_mvc' )->content()->start() ?>
        ... tab content ...
    <?= $tabs->tab'tab_direct_mvc' )->content()->end() ?>
    <?= $tabs->tab'tab_direct_link' )->content()->start() ?>
        ... tab content ...        
    <?= $tabs->tab'tab_direct_link' )->content()->end() ?>
<?= $tabs->end() ?>

Overview of methods

Method Meaning of
public __construct(
string $id,
array $tabs,
?string $selected_tab_id=null
  • $id
    Element ID.
  • $tabs
    A list of tabs in the form of an associated array, where the key is the ID and the value is the tab title.
  • $selected_tab_id
    The ID of the active tab. If not specified, then the first tab is selected.
public getTab(
string $id
) : UI_tabsJS_tab
Returns an instance of a specific tab based on the ID.
public tab(
string $id
) : UI_tabsJS_tab
Alias of the getTab method.
Returns an instance of the specific tab based on the ID.
public getTabs(
) : UI_tabsJS_tab[]
Returns a list of all tabs.
public getSelectedTabId(
) : string
Returns the ID of the active tab.
Previous chapter
Next chapter