PHP code example of gearmagicru / gm-wd-lightgallery

1. Go to this page and download the library: Download gearmagicru/gm-wd-lightgallery library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gearmagicru / gm-wd-lightgallery example snippets


$gallery = Gm::$app->widgets->get(
    'gm.wd.lightgallery', 
    ['galleryId' => 1, 'sort' => 'index', limit' => 10, 'settings' => ['download' => false]]
);
$gallery->run();

echo $this->shortcode('[lightgallery id="1" sort="index" limit="10" download="false"]');

echo $this->widget('gm.wd.lightgallery', [
    'galleryId'  => 1,
    'mode'       => 'list',
    'sort'       => ['default' => 'index,a'],
    'pagination' => ['defaultLimit' => 20],
    'pager'      => [
        'itemTpl'       => '<li>{link}</li>',
        'activeItemTpl' => '<li class="active">{link}</li>',
        'options'       => ['class' => 'justify-content-center']
     ],
     'settings' => ['download' => false]
]);

use Gm\Widget\LightGallery\Widget as Gallery;
echo Gallery::widget(['mode' => 'list', pagination' => ['defaultLimit' => 20]]);