slavkovrn/yii2-prettyphoto

Yii2 prettyPhoto image galary widget uses Lightbox view control jquery.prettyphoto.js

Maintainers

Package info

github.com/SlavKoVrn/yii2-prettyphoto

Type:yii2-extension

pkg:composer/slavkovrn/yii2-prettyphoto

Statistics

Installs: 339

Dependents: 0

Suggesters: 0

Stars: 4

Open Issues: 0

v2.0.0 2019-02-11 07:59 UTC

This package is auto-updated.

Last update: 2026-02-12 07:29:37 UTC


README

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

PrettyPhoto image galary PHP Array generator.

PrettyPhoto image galary

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',
                        ],
                ]
]) ?>

write comments to admin