Skip to content

dynamikaweb/yii2-lightgallery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

dynamikaweb/yii2-lightgallery

php version pkg version license quality build

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 dynamikaweb/yii2-lightgallery

or add

"dynamikaweb/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 \dynamikaweb\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'
            ]
        ],
        'options' => ['class' => 'row'],
        'itemsOptions' => [
            'tag' => 'div',
            'class' => 'col-4 col-sm-5'
        ],
        // more plugins: 
        'plugins' => ['lgZoom', 'lgThumbnail'],
        // more options: 
        'pluginOptions' => [
            'mode' => 'lg-zoom-in-big',
            'download' => false,
            'zoom' => false,
            'share' => false
        ]
    ]);
?>

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.


dynamika soluções web This project is under LGPL V3.0 license.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages