diff --git a/CHANGELOG.md b/CHANGELOG.md index 46ba447..7faecd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Yii Framework 2 bootstrap extension Change Log - Bug #68: Fixed `yii\bootstrap\Nav` handling empty items (freezy-sk) - Bug #81: Fixed `yii\bootstrap\ActiveField::radioList()` and `yii\bootstrap\ActiveField::checkboxList()` ignore `itemOptions` (mikehaertl) - Bug #98: Fixed `yii\bootstrap\ButtonDropdown` setting `href` attribute for non `a` tags (13nightevil) +- Bug #124: Fixed `yii\bootstrap\Tabs` to use `tag` configuration option for item container (arturf) - Enh #45: Added support for Bootstrap checkbox/radio toggle buttons (RomeroMsk, klimov-paul) 2.0.5 September 23, 2015 diff --git a/Tabs.php b/Tabs.php index c6bc35f..3044f11 100644 --- a/Tabs.php +++ b/Tabs.php @@ -194,7 +194,8 @@ class Tabs extends Widget } if ($this->renderTabContent) { - $panes[] = Html::tag('div', isset($item['content']) ? $item['content'] : '', $options); + $tag = ArrayHelper::remove($options, 'tag', 'div'); + $panes[] = Html::tag($tag, isset($item['content']) ? $item['content'] : '', $options); } } diff --git a/tests/TabsTest.php b/tests/TabsTest.php index 43b432c..08e37a6 100644 --- a/tests/TabsTest.php +++ b/tests/TabsTest.php @@ -106,4 +106,24 @@ class TabsTest extends TestCase $this->assertNotContains('InvisibleItem', $html); $this->assertNotContains('Invisible Item Content', $html); } + + public function testItem() + { + $checkTag = 'article'; + + $out = Tabs::widget([ + 'items' => [ + [ + 'label' => 'Page1', 'content' => 'Page1', + ], + [ + 'label' => 'Page2', 'content' => 'Page2', + ], + ], + 'itemOptions' => ['tag' => $checkTag], + 'renderTabContent' => true, + ]); + + $this->assertContains('<' . $checkTag, $out); + } }