Commit 4e64b238 by niskac

added support for hiding prev and next in BootCarousel

parent 137a0f42
......@@ -22,6 +22,10 @@ class BootCarousel extends CWidget
*/
public $next = '›';
/**
* @var boolean whether to display the previous and next links.
*/
public $displayPrevAndNext = true;
/**
* @var array the carousel items configuration.
*/
public $items = array();
......@@ -64,10 +68,14 @@ class BootCarousel extends CWidget
echo CHtml::openTag('div', $this->htmlOptions);
echo '<div class="carousel-inner">';
$this->renderItems($this->items);
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();
......
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