PHP code example of renschs / yii2-swiper

1. Go to this page and download the library: Download renschs/yii2-swiper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

renschs / yii2-swiper example snippets


 

/**
 * @var \yii\web\View $this
 */
use renschs\yii2\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
    ]
  ]
] );
 
Shell
$ php composer.phar