|
|
|
@ -31,6 +31,10 @@ use yii\helpers\Html;
|
|
|
|
|
* 'options' => ['id' => 'myveryownID'], |
|
|
|
|
* ], |
|
|
|
|
* [ |
|
|
|
|
* 'label' => 'Example', |
|
|
|
|
* 'url' => 'http://www.example.com', |
|
|
|
|
* ], |
|
|
|
|
* [ |
|
|
|
|
* 'label' => 'Dropdown', |
|
|
|
|
* 'items' => [ |
|
|
|
|
* [ |
|
|
|
@ -63,6 +67,8 @@ class Tabs extends Widget
|
|
|
|
|
* - headerOptions: array, optional, the HTML attributes of the tab header. |
|
|
|
|
* - linkOptions: array, optional, the HTML attributes of the tab header link tags. |
|
|
|
|
* - content: string, optional, the content (HTML) of the tab pane. |
|
|
|
|
* - url: string, optional, an external URL. When this is specified, clicking on this tab will bring |
|
|
|
|
* the browser to this URL. This option is available since version 2.0.4. |
|
|
|
|
* - options: array, optional, the HTML attributes of the tab pane container. |
|
|
|
|
* - active: boolean, optional, whether the item tab header and pane should be visible or not. |
|
|
|
|
* - items: array, optional, can be used instead of `content` to specify a dropdown items |
|
|
|
@ -171,8 +177,14 @@ class Tabs extends Widget
|
|
|
|
|
Html::addCssClass($options, 'active'); |
|
|
|
|
Html::addCssClass($headerOptions, 'active'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (isset($item['url'])) { |
|
|
|
|
$header = Html::a($label, $item['url'], $linkOptions); |
|
|
|
|
} else { |
|
|
|
|
$linkOptions['data-toggle'] = 'tab'; |
|
|
|
|
$header = Html::a($label, '#' . $options['id'], $linkOptions); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($this->renderTabContent) { |
|
|
|
|
$panes[] = Html::tag('div', isset($item['content']) ? $item['content'] : '', $options); |
|
|
|
|
} |
|
|
|
|