wcj343169893 / yii2-lightgallery
widget lightgallery
Installs: 1 090
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 1
Type:yii2-extension
Requires
- npm-asset/lightgallery: *
- yiisoft/yii2: *
README
Description
This Widget is based on LightGallery for use in Yii2 Framework. See full documentattion
Installation
The preferred way to install this extension is through composer.
Either run
composer require wcj343169893/yii2-lightgallery
or add
"wcj343169893/yii2-lightgallery": "*"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply use it in your code by :
<?php echo \wcj343169893\lightgallery\LightGallery::widget([ 'items' => [ [ 'thumb' => '../thumb/image_1.jpg', 'src' => '../big/image_1.jpg', 'caption' => '<h4> caption </h4><p> ... </p>', 'imgOptions' => [ 'width' => '100%', 'alt' => 'description' ] ], [ 'thumb' => '../thumb/image_2.jpg', 'src' => '../big/image_2.jpg' ] ], // more plugins: 'plugins' => ['lgZoom', 'lgThumbnail'] ]); ?>
To add plugins just add their name to the plugins option plugins =>['lgZoom]
, see the full list.
For other LightGallery options use pluginOptions, see documentation.
This project is under LGPL V3.0 license.