yii2-imagegalary The Yii2 extension uses jQuery PrettyPhoto and OwlCarousel js and makes image galary from php array of structure defined.

  1. Requirements
  2. Installation
  3. Usage
  4. Resources

The Yii2 extension uses jQuery PrettyPhoto and OwlCarousel js and makes image galary from php array of structure defined.

Visualize

Requirements

"yiisoft/yii2": "~2.0"

Installation

The preferred way to install this extension is through composer.

Either run:

composer require slavkovrn/yii2-imagegalary

or add

"slavkovrn/yii2-imagegalary": "*"

to the require section of your composer.json file.

Usage

Set link to extension in your view:

<?php

use slavkovrn\imagegalary\ImageGalaryWidget;

?>

<?= ImageGalaryWidget::widget([
    'id' =>'imagegalary',       // id of plugin should be unique at page
    'class' =>'imagegalary',    // class of div to define style
    'css' => 'border:white;',   // css commands of class (for example - border-radius:5px;)
    'image_width' => 320,       // height of image visible in pixels
    'image_height' => 240,      // width of image visible in pixels
    'thumb_width' => 80,        // height of thumb images in pixels
    'thumb_height' => 50,       // width of thumb images in pixels
    'items' => 3,               // number of thumb items
    'images' => [               // images of galary
        [
                'src' => 'http://yii2.kadastrcard.ru/uploads/prettyphoto/image1.jpg',
                'title' => 'Image visible in widget',
        ],
        [
                'src' => 'http://yii2.kadastrcard.ru/uploads/prettyphoto/image2.jpg',
                'title' => 'image 1',
        ],
        [
                'src' => 'http://yii2.kadastrcard.ru/uploads/prettyphoto/image3.jpg',
                'title' => 'image 2',
        ],
        [
                'src' => 'http://yii2.kadastrcard.ru/uploads/prettyphoto/image4.jpg',
                'title' => 'image 3',
        ],
    ]
]) ?>

Resources

0 0
1 follower
0 downloads
Yii Version: 2.0
License: MIT
Category: User Interface
Developed by: Viacheslav Kolesnikov
Created on: Aug 6, 2017
Last updated: 7 years ago

Related Extensions