Skip to content

Yii2 widget for Swiper slider gallery

License

Notifications You must be signed in to change notification settings

bestyii/yii2-swiper

 
 

Repository files navigation

Yii2-swiper Coverage 100% License MIT

Yii2 widget for Swiper slider. See more here: https://github.com/nolimits4web/Swiper/.

You can find examples in demos folder.

Also you can read documentation.

Installation

You can get this extension through Composer.

Before install config composer repositories

 "repositories": {
    "0": {
      "type": "composer",
      "url": "https://asset-packagist.org"
    }
  }

Either run in terminal

$ php composer.phar require "bestyii/yii2-swiper" "*"

or add

"bestyii/yii2-swiper" : "*"

to the require section of your application's composer.json file.

###Usage

 
<?php
/**
 * @var \yii\web\View $this
 */
use bestyii\swiper\Swiper;

echo Swiper::widget( [
  'items'         => [
    [ 'background' => 'http://lorempixel.com/600/600/nature/1' ],
    [ 'background' => 'http://lorempixel.com/600/600/nature/2' ],
    [ 'background' => 'http://lorempixel.com/600/600/nature/3' ],
    [ 'background' => 'http://lorempixel.com/600/600/nature/4' ],
    [ 'background' => 'http://lorempixel.com/600/600/nature/5' ]
  ],
  'behaviours'    => [
    'pagination'
  ],
  'pluginOptions' => [
    'grabCursor'     => true,
    'centeredSlides' => true,
    'slidesPerView'  => 'auto',
    'effect'         => 'coverflow',
    'coverflow'      => [
        'rotate'       => 50,
        'stretch'      => 0,
        'depth'        => 100,
        'modifier'     => 1,
        'slideShadows' => true
    ]
  ]
] );
 

Issues

If some problems occurred, you can create issue.

Thank you for attention.

About

Yii2 widget for Swiper slider gallery

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%