A simple slideshow made with http://idangero.us/swiper.
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist melledijkstra/yii2-slideshow "*"
or add
"melledijkstra/yii2-slideshow": "*"
to the require section of your composer.json
file.
Once the extension is installed, simply use it in your code by :
<?= \melledijkstra\slideshow\Slideshow::widget([
'items' => [
[
'content' => 'Slide 1', // tip: $this->render('view');
],
[
'content' => 'Slide 2',
'active' => true,
]
],
// The client options will be passed to the Javascript swiper library
// @see http://idangero.us/swiper/api/#parameters
'clientOptions' => [
'direction' => 'horizontal',
'speed' => 300,
'autoplay' => true,
]
]); ?>