Browse Source

Fix: get item container from config

- Add unit test for check rendering item container

close #124
tags/2.0.6
artur 9 years ago committed by Carsten Brandt
parent
commit
4133d6b26f
  1. 1
      CHANGELOG.md
  2. 3
      Tabs.php
  3. 20
      tests/TabsTest.php

1
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 #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 #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 #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) - Enh #45: Added support for Bootstrap checkbox/radio toggle buttons (RomeroMsk, klimov-paul)
2.0.5 September 23, 2015 2.0.5 September 23, 2015

3
Tabs.php

@ -194,7 +194,8 @@ class Tabs extends Widget
} }
if ($this->renderTabContent) { 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);
} }
} }

20
tests/TabsTest.php

@ -106,4 +106,24 @@ class TabsTest extends TestCase
$this->assertNotContains('InvisibleItem', $html); $this->assertNotContains('InvisibleItem', $html);
$this->assertNotContains('Invisible Item Content', $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);
}
} }

Loading…
Cancel
Save