Commit b2312690 by RomeroMsk Committed by Qiang Xue

Fixes #5708

Fixes #5708
parent f03e6f0a
...@@ -101,6 +101,10 @@ class Tabs extends Widget ...@@ -101,6 +101,10 @@ class Tabs extends Widget
* @var string specifies the Bootstrap tab styling. * @var string specifies the Bootstrap tab styling.
*/ */
public $navType = 'nav-tabs'; public $navType = 'nav-tabs';
/**
* @var boolean whether the tab-content container should be rendered.
*/
public $renderTabContent = true;
/** /**
...@@ -167,14 +171,16 @@ class Tabs extends Widget ...@@ -167,14 +171,16 @@ class Tabs extends Widget
} }
$linkOptions['data-toggle'] = 'tab'; $linkOptions['data-toggle'] = 'tab';
$header = Html::a($label, '#' . $options['id'], $linkOptions); $header = Html::a($label, '#' . $options['id'], $linkOptions);
if ($this->renderTabContent) {
$panes[] = Html::tag('div', isset($item['content']) ? $item['content'] : '', $options); $panes[] = Html::tag('div', isset($item['content']) ? $item['content'] : '', $options);
} }
}
$headers[] = Html::tag('li', $header, $headerOptions); $headers[] = Html::tag('li', $header, $headerOptions);
} }
return Html::tag('ul', implode("\n", $headers), $this->options) . "\n" return Html::tag('ul', implode("\n", $headers), $this->options)
. Html::tag('div', implode("\n", $panes), ['class' => 'tab-content']); . ($this->renderTabContent ? "\n" . Html::tag('div', implode("\n", $panes), ['class' => 'tab-content']) : '');
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment