BootSlider use Twitter's Bootstrap extension together with Yii. There are sevral Yii-widgets that allow you to easily use Bootstrap with Yii.BootSlider is a widget that use Carousel in Twitter's Bootstrap and extended from CListView so using CArrayDataProvider or CActiveDataProvider we can create image slider
added auto slider
'slide'=>array(true,2000),//to slide after 2seconds
'slide'=>array(true),// default after 6seconds
/*
no need to use 'slide' if no automatic sliding is needed
--- or -----
'slide'=>array(false),
*/
setup bootstrap extension in your yii app by referring http://www.yiiframework.com/extension/bootstrap then add this widget in your "protected/extensions/bootstrap/widgets"
then use following code set pagination always false
//$rawData is array $listDataProvider=new CArrayDataProvider($rawData, array( 'pagination'=>false,//always false )); <?php $this->widget('bootstrap.widgets.BootSlider', array('itemView'=>'_list',//_lsit is the php file to render 'id'=>'Mycarouse1',//id of Carousel 'slide'=>array(true,2000),//to slide after 2seconds 'dataProvider'=>$listDataProvider, 'coloumCount'=>4,//no of items to shown in slider )); //_list.php <style> a #image{ height:150px; } </style> <div class="thumbnail span2"> <img id="image" src="<?php echo Yii::app()->baseUrl.'/images/'.$data['image']; ?>" alt=""> </div>
support@nintriva.com * Nintriva
Total 3 comments
nice extensions
good one. working fine for me.
Bootstrap and its behaviors do not have a method or closure named "enableTransitions". I am sure this is from all the changes that have been made to bootstrap since you last updated this extension. Any idea how to fix it?
Leave a comment
Please login to leave your comment.