yii2-imagecarousel The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.

Image carousel widget for Yii2 Framework

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

The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.

Image galary PHP Array generator.

Image galary

Requirements

Yii 2.0 framework or above

Installation

The preferred way to install this extension is through composer.

Either run: ~~~ composer require slavkovrn/yii2-imagecarousel ~~~

or add

"slavkovrn/yii2-imagecarousel": "*"

to the require section of your composer.json file.

Usage

Set link to extension in your view:

<?php

use slavkovrn\imagecarousel\ImageCarouselWidget;

?>

<?= ImageCarouselWidget::widget([
    'id' =>'image-carousel',    // unique id of widget
    'width' => 960,             // width of widget container
    'height' => 300,            // height of widget container
    'img_width' => 320,         // width of central image
    'img_height' => 180,        // height of central image
    'images' => [               // images of carousel
        [
                'src' => 'http://yii2.kadastrcard.ru/uploads/prettyphoto/image1.jpg',
                'alt' => 'Image 1',
        ],
        [
                'src' => 'http://yii2.kadastrcard.ru/uploads/prettyphoto/image2.jpg',
                'alt' => 'image 2',
        ],
        [
                'src' => 'http://yii2.kadastrcard.ru/uploads/prettyphoto/image3.jpg',
                'alt' => 'image 3',
        ],
        [
                'src' => 'http://yii2.kadastrcard.ru/uploads/prettyphoto/image4.jpg',
                'alt' => 'image 4',
        ],
    ]
]) ?>

Resources

write comments to admin

0 0
1 follower
0 downloads
Yii Version: 2.0
License: MIT
Category: User Interface
Developed by: SlavKoVrn
Created on: Jan 7, 2018
Last updated: 3 years ago

Related Extensions