Yii2 wrapper for Vegas: a jQuery/Zepto plugin to add beautiful backgrounds and Slideshows to DOM elements
The preferred way to install this extension is through composer.
Either run
composer require --dev ellotta/yii2-vegas "*"
or add
"ellotta/yii2-vegas": "*"
to the require-dev section of your composer.json
file.
Once the extension is installed, simply use it in your code by :
Vegas::widget([
'selector' => 'body', //default selector
'jsOptions' => [
'slides' => [
['src' => 'https://dummyimage.com/800x600/000/ffffff.gif&text=1'],
['src' => 'https://dummyimage.com/800x600/000/ffffff.gif&text=2'],
['src' => 'https://dummyimage.com/800x600/000/ffffff.gif&text=3'],
],
'animation' => 'kenburnsUp',
],
]);
See plugin documentation for more information.