Commits

Christoffer Niska  committed 43a82ba

added support for hiding prev and next in BootCarousel

  • Participants
  • Parent commits 4aa8d79

Comments (0)

Files changed (1)

File widgets/BootCarousel.php

 	 */
 	public $next = '›';
 	/**
+	 * @var boolean whether to display the previous and next links.
+	 */
+	public $displayPrevAndNext = true;
+	/**
 	 * @var array the carousel items configuration.
 	 */
 	public $items = array();
 		echo CHtml::openTag('div', $this->htmlOptions);
 		echo '<div class="carousel-inner">';
 		$this->renderItems($this->items);
-		echo '</div>';
-		echo '<a class="carousel-control left" href="#'.$id.'" data-slide="prev">'.$this->prev.'</a>';
-		echo '<a class="carousel-control right" href="#'.$id.'" data-slide="next">'.$this->next.'</a>';
-		echo '</div>';
+
+		if ($this->displayPrevAndNext)
+		{
+			echo '</div>';
+			echo '<a class="carousel-control left" href="#'.$id.'" data-slide="prev">'.$this->prev.'</a>';
+			echo '<a class="carousel-control right" href="#'.$id.'" data-slide="next">'.$this->next.'</a>';
+			echo '</div>';
+		}
 
 		/** @var CClientScript $cs */
 		$cs = Yii::app()->getClientScript();