Commit dcc8d047 by Serge Postrash Committed by Alexander Makarov

Fixes #4362: Made carousel indicators optional

parent 6d64d62c
...@@ -10,6 +10,7 @@ Yii Framework 2 bootstrap extension Change Log ...@@ -10,6 +10,7 @@ Yii Framework 2 bootstrap extension Change Log
- Enh #4024: Added ability to `yii\bootstrap\Tabs` to encode each `Tabs::items['label']` separately (creocoder, umneeq) - Enh #4024: Added ability to `yii\bootstrap\Tabs` to encode each `Tabs::items['label']` separately (creocoder, umneeq)
- Chg #3036: Upgraded Twitter Bootstrap to 3.1.x (qiangxue) - Chg #3036: Upgraded Twitter Bootstrap to 3.1.x (qiangxue)
- Enh #4120: Added ability for each item to choose it's encoding option in `Dropdown` and `Nav` (Alex-Code) - Enh #4120: Added ability for each item to choose it's encoding option in `Dropdown` and `Nav` (Alex-Code)
- Enh #4363: Added `showIndicators` property to make Carousel indicators optional (sdkiller)
2.0.0-beta April 13, 2014 2.0.0-beta April 13, 2014
------------------------- -------------------------
......
...@@ -45,6 +45,11 @@ class Carousel extends Widget ...@@ -45,6 +45,11 @@ class Carousel extends Widget
*/ */
public $controls = ['‹', '›']; public $controls = ['‹', '›'];
/** /**
* @var boolean
* If false carousel indicators (<ol> tag with anchors to items) should not be displayed.
*/
public $showIndicators = true;
/**
* @var array list of slides in the carousel. Each array element represents a single * @var array list of slides in the carousel. Each array element represents a single
* slide with the following structure: * slide with the following structure:
* *
...@@ -89,6 +94,9 @@ class Carousel extends Widget ...@@ -89,6 +94,9 @@ class Carousel extends Widget
*/ */
public function renderIndicators() public function renderIndicators()
{ {
if ($this->showIndicators === false) {
return '';
}
$indicators = []; $indicators = [];
for ($i = 0, $count = count($this->items); $i < $count; $i++) { for ($i = 0, $count = count($this->items); $i < $count; $i++) {
$options = ['data-target' => '#' . $this->options['id'], 'data-slide-to' => $i]; $options = ['data-target' => '#' . $this->options['id'], 'data-slide-to' => $i];
......
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