Back to Bootstrap class

Method addTab

public static string
addTab
(mixed $selector, mixed $id, mixed $title)
Begins the display of a new tab content panel.
Parameters
  • string $selector Identifier of the panel. Expects a valid ID without the #!
  • string $id The ID of the div element. Expects a valid ID without the #!
  • string $title The title text for the new UL tab
Returns
  • string HTML to start a new panel
Since
  • 3.1
Class: Bootstrap
Project: Joomla

Method addTab - Source code

/**
 * Begins the display of a new tab content panel.
 *
 * @param   string  $selector  Identifier of the panel. Expects a valid ID without the #!
 * @param   string  $id        The ID of the div element. Expects a valid ID without the #!
 * @param   string  $title     The title text for the new UL tab
 *
 * @return  string  HTML to start a new panel
 *
 * @since   3.1
 */
public static function addTab($selector, $id, $title) : string
{
    static $tabLayout = null;
    $tabLayout = $tabLayout === null ? new FileLayout('libraries.html.bootstrap.tab.addtab') : $tabLayout;
    $active = static::$loaded[__CLASS__ . '::startTabSet'][$selector]['active'] == $id ? ' active' : '';
    return $tabLayout->render(['id' => preg_replace('/^[\\.#]/', '', $id), 'active' => $active, 'title' => $title]);
}