Commit 1629f041 authored by Thiago Talma's avatar Thiago Talma Committed by Alexander Makarov

Fixes #174: Added `yii\bootstrap\Tabs::renderPanes()` to allow extending the...

Fixes #174: Added `yii\bootstrap\Tabs::renderPanes()` to allow extending the class to manipulate the content between the tabs and the content
parent bd2427e1
......@@ -11,6 +11,7 @@ Yii Framework 2 bootstrap extension Change Log
- Enh #113: Allow URLs instead of content for Tab Widget Dropdown items (Okeanos)
- Bug #143: Fixed `yii\bootstrap\Nav` to use tags according to bootstrap docs (PowerGamer1)
- Bug #162: Fixed `yii\bootstrap\Nav` not taking explicit `active` into account when `activateItems` is off (samdark)
- Enh #174: Added `yii\bootstrap\Tabs::renderPanes()` to allow extending the class to manipulate the content between the tabs and the content (thiagotalma)
2.0.6 March 17, 2016
--------------------
......
......@@ -213,8 +213,7 @@ class Tabs extends Widget
$headers[] = Html::tag('li', $header, $headerOptions);
}
return Html::tag('ul', implode("\n", $headers), $this->options)
. ($this->renderTabContent ? "\n" . Html::tag('div', implode("\n", $panes), ['class' => 'tab-content']) : '');
return Html::tag('ul', implode("\n", $headers), $this->options) . $this->renderPanes($panes);
}
/**
......@@ -279,4 +278,16 @@ class Tabs extends Widget
return $itemActive;
}
/**
* Renders tab panes.
*
* @param array $panes
* @return string the rendering result.
* @since 2.0.7
*/
public function renderPanes($panes)
{
return $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