2017 © Pedro Peláez
 

yii2-extension yii2-slider-pro

Yii2 widget for slider-pro

image

edofre/yii2-slider-pro

Yii2 widget for slider-pro

  • Monday, January 8, 2018
  • by edofre
  • Repository
  • 1 Watchers
  • 9 Stars
  • 729 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 10 Versions
  • 8 % Grown

The README.md

Yii2 slider-pro widget

Latest Stable Version Total Downloads Latest Unstable Version License composer.lock, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

To install, either run, (*3)

$ php composer.phar require edofre/yii2-slider-pro "V1.1.6"

or add, (*4)

"edofre/yii2-slider-pro": "V1.1.6"

to the require section of your composer.json file., (*5)

Usage

Not all available modules are available as objects, these will be implemented at a later date, if you need exact/precise control please use the second method of creating the slider., (*6)

The following 2 ways are available to instantiate the slider:, (*7)

1. You can use either the supplied php classes to generate the HTML

use edofre\sliderpro\models\Slide;
use edofre\sliderpro\models\slides\Caption;
use edofre\sliderpro\models\slides\Image;
use edofre\sliderpro\models\slides\Layer;

$slides = [
    new Slide([
        'items' => [
            new Image(['src' => '/images/test.jpg']),
        ],
    ]),
    new Slide([
        'items' => [
            new Image(['src' => '/images/test1.png']),
            new Caption(['tag' => 'p', 'content' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.']),
        ],
    ]),
    new Slide([
        'items' => [
            new Image(['src' => '/images/test2.png']),
            new Layer(['tag' => 'h3', 'content' => 'Lorem ipsum dolor sit amet', 'htmlOptions' => ['class' => 'sp-black', 'data-position' => "bottomLeft", 'data-horizontal' => "10%", 'data-show-transition' => "left", 'data-show-delay' => "300", 'data-hide-transition' => "right"]]),
            new Layer(['tag' => 'p', 'content' => 'consectetur adipisicing elit', 'htmlOptions' => ['class' => 'sp-white sp-padding', 'data-width' => "200", 'data-horizontal' => "center", 'data-vertical' => "40%", 'data-show-transition' => "down", 'data-hide-transition' => "up"]]),
            new Layer(['tag' => 'div', 'content' => 'Static content', 'htmlOptions' => ['class' => 'sp-static']]),
        ],
    ]),
    new Slide([
        'content' =>
            '<a class="sp-video" href="http://vimeo.com/109354891">
                <img src="http://lorempixel.com/960/500/sports/5" width="500" height="300"/>
            </a>'
        ,
    ]),
    new Slide([
        'items' => [
            new Layer(['tag' => 'h3', 'content' => 'Lorem ipsum dolor sit amet']),
            new Layer(['tag' => 'p', 'content' => 'Consectetur adipisicing elit']),
        ],
    ]),
];

$thumbnails = [
    new \edofre\sliderpro\models\Thumbnail(['tag' => 'img', 'htmlOptions' => ['src' => "/images/ttest.jpg", 'data-src' => "/images/test.jpg"]]),
    new \edofre\sliderpro\models\Thumbnail(['tag' => 'img', 'htmlOptions' => ['src' => "/images/ttest1.png", 'data-src' => "/images/test1.png"]]),
    new \edofre\sliderpro\models\Thumbnail(['tag' => 'img', 'htmlOptions' => ['src' => "/images/ttest2.png", 'data-src' => "/images/test2.png"]]),
    new \edofre\sliderpro\models\Thumbnail(['tag' => 'p', 'content' => 'Thumbnail for video']),
    new \edofre\sliderpro\models\Thumbnail(['tag' => 'p', 'content' => 'Thumbnail 5']),
];
?>

= \edofre\sliderpro\SliderPro::widget([
    'id'            => 'my-slider',
    'slides'        => $slides,
    'thumbnails'    => $thumbnails,
    'sliderOptions' => [
        'width'  => 960,
        'height' => 500,
        'arrows' => true,
        'init'   => new \yii\web\JsExpression("
            function() {
                console.log('slider is initialized');
            }
        "),
    ],
]);
?>

2. Or you can create your own HTML code to generate the slider

= \edofre\sliderpro\SliderPro::widget([
    'id'            => 'my-slider',
    'sliderOptions' => [
        'width'  => 960,
        'height' => 500,
        'arrows' => true,
        'init'   => new \yii\web\JsExpression("
            function() {
                console.log('slider is initialized');
            }
        "),
    ],
]);
?>



Lorem ipsum dolor sit amet, consectetur adipisicing elit., (*8)

Lorem ipsum dolor sit amet, (*9)

Lorem ipsum dolor sit amet

consectetur adipisicing elit , (*10)

Static content

Lorem ipsum dolor sit amet

consectetur adipisicing elit, (*11)

Thumbnail 4, (*12)

Thumbnail 5, (*13)

The Versions

08/01 2018

dev-master

9999999-dev https://github.com/edofre/yii2-slider-pro

Yii2 widget for slider-pro

  Sources   Download

MIT

The Requires

 

by Edo Freriks

jquery images slider slider-pro

31/03 2017

V1.1.6

1.1.6.0 https://github.com/edofre/yii2-slider-pro

Yii2 widget for slider-pro

  Sources   Download

MIT

The Requires

 

by Edo Freriks

jquery images slider slider-pro

31/03 2017

v1.1.6.x-dev

1.1.6.9999999-dev https://github.com/edofre/yii2-slider-pro

Yii2 widget for slider-pro

  Sources   Download

MIT

The Requires

 

by Edo Freriks

jquery images slider slider-pro

30/12 2016

v1.1.5.x-dev

1.1.5.9999999-dev https://github.com/edofre/yii2-slider-pro

Yii2 widget for slider-pro

  Sources   Download

MIT

The Requires

 

by Edo Freriks

jquery images slider slider-pro

30/12 2016

V1.1.5

1.1.5.0 https://github.com/edofre/yii2-slider-pro

Yii2 widget for slider-pro

  Sources   Download

MIT

The Requires

 

by Edo Freriks

jquery images slider slider-pro

23/12 2016

v1.1.4.x-dev

1.1.4.9999999-dev https://github.com/edofre/yii2-slider-pro

Yii2 widget for slider-pro

  Sources   Download

MIT

The Requires

 

by Edo Freriks

jquery images slider slider-pro

23/12 2016

V1.1.4

1.1.4.0 https://github.com/edofre/yii2-slider-pro

Yii2 widget for slider-pro

  Sources   Download

MIT

The Requires

 

by Edo Freriks

jquery images slider slider-pro

12/12 2016

V1.1.3

1.1.3.0 https://github.com/edofre/yii2-slider-pro

Yii2 widget for slider-pro

  Sources   Download

MIT

The Requires

 

by Edo Freriks

jquery images slider slider-pro

21/06 2016

V1.1.1

1.1.1.0 https://github.com/edofre/yii2-slider-pro

Yii2 widget for slider-pro

  Sources   Download

MIT

The Requires

 

by Edo Freriks

jquery images slider slider-pro

20/06 2016

V1.0.0

1.0.0.0 https://github.com/edofre/yii2-slider-pro

Yii2 widget for slider-pro

  Sources   Download

MIT

The Requires

 

by Edo Freriks

jquery images slider slider-pro