From 5e10e2833b960662f74c591cebb7506095baea7b Mon Sep 17 00:00:00 2001 From: Serge Postrash Date: Sat, 19 Jul 2014 22:00:49 +0400 Subject: [PATCH] Fixes #4362: Made carousel indicators optional --- CHANGELOG.md | 1 + Carousel.php | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5a204c..c422193 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) - 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 #4363: Added `showIndicators` property to make Carousel indicators optional (sdkiller) 2.0.0-beta April 13, 2014 ------------------------- diff --git a/Carousel.php b/Carousel.php index 90fe0bd..25027f2 100644 --- a/Carousel.php +++ b/Carousel.php @@ -45,6 +45,11 @@ class Carousel extends Widget */ public $controls = ['‹', '›']; /** + * @var boolean + * If false carousel indicators (
    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 * slide with the following structure: * @@ -89,6 +94,9 @@ class Carousel extends Widget */ public function renderIndicators() { + if ($this->showIndicators === false) { + return ''; + } $indicators = []; for ($i = 0, $count = count($this->items); $i < $count; $i++) { $options = ['data-target' => '#' . $this->options['id'], 'data-slide-to' => $i];