- Lightbox widget based on Lightbox2 extension http://lokeshdhakar.com/projects/lightbox2/
Installation
The preferred way to install this extension is through composer., (*1)
Either run, (*2)
php composer.phar require --prefer-dist branchonline/yii2-lightbox "*"
or add, (*3)
"branchonline/yii2-lightbox": "*"
to the require section of your composer.json., (*4)
Usage
Once the extension is installed, simply add widget to your page as follows:, (*5)
echo Lightbox::widget([
'files' => [
[
'thumb' => 'url/to/thumb.ext',
'original' => 'url/to/original.ext',
'title' => 'optional title',
],
]
]);