yeesoft / yii2-lightbox
Lightbox widget for Yii2
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 2 637
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 5
Open Issues: 0
Type:yii2-extension
Requires
- bower-asset/lightbox2: ~2.8
- yiisoft/yii2: ~2.0
This package is auto-updated.
Last update: 2022-03-29 00:26:04 UTC
README
Lightbox Widget for Yii 2
This module is a wrapper for Lightbox2
Installation
The preferred way to install this extension is through composer.
Either run
composer require --prefer-dist yeesoft/yii2-lightbox "~0.1.0"
or add
"yeesoft/yii2-lightbox": "~0.1.0"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply add widget to your page as follows:
use yeesoft\lightbox\Lightbox; echo Lightbox::widget([ 'options' => [ 'fadeDuration' => '2000', 'albumLabel' => "Image %1 of %2", ], 'linkOptions' => ['class' => 'pull-left'], 'imageOptions' => ['class' => 'thumbnail'], 'items' => [ [ 'thumb' => '/images/image01-120x90.jpg', 'image' => '/images/image01.jpg', 'title' => 'Image 1', 'group' => 'image-set1', ], [ 'thumb' => '/images/image02-120x90.jpg', 'image' => '/images/image02.jpg', 'title' => 'Image 2', 'group' => 'image-set1', ], ], ]);