yii2-slavkovrn-prettyphoto The extension uses jQuery prettyPhoto.js and makes image galary from php array of structure defined.

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

PrettyPhoto image galary widget for Yii2 Framework

prettyPhoto

Requirements

"yiisoft/yii2": "~2.0"

Installation

The preferred way to install this extension is through composer.

Either run:

composer require slavkovrn/yii2-prettyphoto

or add

"slavkovrn/yii2-prettyphoto": "*"

to the require section of your composer.json file.

Usage

Set link to extension in your view:

<?php

use slavkovrn\prettyphoto\PrettyPhotoWidget;

?>

<?= PrettyPhotoWidget::widget([
    'id'     =>'prettyPhoto', // id of plugin should be unique at page
    'class'  =>'galary',      // class of plugin to define a style
    'width' => '50%',         // width of image visible in widget (omit - initial width)
    'height' => '100px',      // height of image visible in widget (omit - initial height)
    'images' => [               // images at popup window of prettyPhoto galary
          1 => [
                 'src' => 'http://yii2.kadastrcard.ru/uploads/prettyphoto/image1.jpg',
                 'title' => 'Image visible in widget',
               ],
          2 => [
                 'src' => 'http://yii2.kadastrcard.ru/uploads/prettyphoto/image2.jpg',
                 'title' => 'image 1',
               ],
          3 => [
                 'src' => 'http://yii2.kadastrcard.ru/uploads/prettyphoto/image3.jpg',
                 'title' => 'image 2',
               ],
          4 => [
                 'src' => 'http://yii2.kadastrcard.ru/uploads/prettyphoto/image4.jpg',
                 'title' => 'image 3',
               ],
           ]
]) ?>

Resources

0 0
1 follower
0 downloads
Yii Version: 2.0
License: (not set)
Category: User Interface
Developed by: Viacheslav Kolesnikov
Created on: Jul 29, 2017
Last updated: 9 months ago

Related Extensions