2017 © Pedro Peláez
 

yii2-extension yii2-owl-carousel-2

Renders a Owl Carousel 2 widget for Yii2.

image

dominus77/yii2-owl-carousel-2

Renders a Owl Carousel 2 widget for Yii2.

  • Saturday, February 17, 2018
  • by dominus77
  • Repository
  • 1 Watchers
  • 0 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

yii2-owl-carousel-2

Latest Stable Version License Total Downloads, (*1)

Renders a Owl Carousel 2 widget for Yii2., (*2)

Installation

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

Either run, (*4)

php composer.phar require dominus77/yii2-owl-carousel-2

or add, (*5)

"dominus77/yii2-owl-carousel-2": "^1.0"

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

Usage

Once the extension is installed, simply use it in your code by :, (*7)

Basic

Variant 1:, (*8)

<?= \dominus77\owlcarousel2\Carousel::widget([
    'items' => $this->render('@dominus77/owlcarousel2/example/_items'), // example
    //'theme' => \dominus77\owlcarousel2\Carousel::THEME_GREEN, // THEME_DEFAULT, THEME_GREEN
    //'tag' => 'div', // container tag name, default div
    //'containerOptions' => [/* ... */], // container html options
    'clientOptions' => [
        'loop' => true,
        'margin' => 10,
        'nav' => true,
        'responsive' => [
            0 => [
                'items' => 1,
            ],
            600 => [
                'items' => 3,
            ],
            1000 => [
                'items' => 5,
            ],
        ],
    ],
]); ?>

Items, (*9)

<div class="item"><h4>1</h4></div>
<div class="item"><h4>2</h4></div>
<div class="item"><h4>3</h4></div>
<div class="item"><h4>4</h4></div>
<div class="item"><h4>5</h4></div>
<div class="item"><h4>6</h4></div>
<div class="item"><h4>7</h4></div>
<div class="item"><h4>8</h4></div>
<div class="item"><h4>9</h4></div>
<div class="item"><h4>10</h4></div>
<div class="item"><h4>11</h4></div>
<div class="item"><h4>12</h4></div>

Variant 2, Wrap Carousel:, (*10)

 \dominus77\owlcarousel2\Carousel::THEME_GREEN, // THEME_DEFAULT, THEME_GREEN
    //'tag' => 'div', // container tag name, default div
    //'containerOptions' => [/* ... */], // container html options
    'clientOptions' => [
        'loop' => true,
        'margin' => 10,
        'nav' => true,
        'responsive' => [
            0 => [
                'items' => 1,
            ],
            600 => [
                'items' => 3,
            ],
            1000 => [
                'items' => 5,
            ],
        ],
    ],
]); ?>

    <!-- begin Items -->
    <div class="item"><h4>1</h4></div>
    <div class="item"><h4>2</h4></div>
    <div class="item"><h4>3</h4></div>
    <div class="item"><h4>4</h4></div>
    <div class="item"><h4>5</h4></div>
    <div class="item"><h4>6</h4></div>
    <div class="item"><h4>7</h4></div>
    <div class="item"><h4>8</h4></div>
    <div class="item"><h4>9</h4></div>
    <div class="item"><h4>10</h4></div>
    <div class="item"><h4>11</h4></div>
    <div class="item"><h4>12</h4></div>
    <!-- end Items -->


Responsive

<?= \dominus77\owlcarousel2\Carousel::widget([
    'items' => $this->render('@dominus77/owlcarousel2/example/_items'), // example
    'clientOptions' => [
        'loop' => true,
        'margin' => 10,
        'responsiveClass' => true,
        'responsive' => [
            0 => [
                'items' => 1,
                'nav' => true,
            ],
            600 => [
                'items' => 3,
                'nav' => false,
            ],
            1000 => [
                'items' => 5,
                'nav' => true,
                'loop' => false,
            ],
        ],
    ],
]); ?>

Animate

<?= \dominus77\owlcarousel2\Carousel::widget([
    'items' => $this->render('@dominus77/owlcarousel2/example/_items'), // example
    'clientOptions' => [
        'animateOut' => 'slideOutDown',
        'animateIn' => 'flipInX',
        'items' => 1,
        'margin' => 30,
        'stagePadding' => 30,
        'smartSpeed' => 450,
    ],
]); ?>

Autoplay

<?= \dominus77\owlcarousel2\Carousel::widget([
    'items' => $this->render('@dominus77/owlcarousel2/example/_items'), // example
    'clientOptions' => [
        'items' => 4,
        'loop' => true,
        'margin' => 10,
        'autoplay' => true,
        'autoplayTimeout' => 1000,
        'autoplayHoverPause' => true,
    ],
    'clientScript' => new \yii\web\JsExpression("
        $('.play').on('click',function(){
            owl.trigger('play.owl.autoplay',[1000])
        })
        $('.stop').on('click',function(){
            owl.trigger('stop.owl.autoplay')
        })
    "),
]); ?>
<hr>
<a class="btn btn-primary play">Play</a>
<a class="btn btn-primary stop">Stop</a>

Demo

Pleas, check the Demos, (*11)

More Information

Please, check the Owl Carousel 2, (*12)

License

The MIT License (MIT). Please see License File for more information., (*13)

The Versions

17/02 2018

dev-master

9999999-dev

Renders a Owl Carousel 2 widget for Yii2.

  Sources   Download

BSD-3-Clause BSD-3

The Requires

 

by Alexey Schevchenko

extension yii2 widget dominus77 yii2-owl-carousel-2

25/10 2017

v1.0.3

1.0.3.0

Renders a Owl Carousel 2 widget for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexey Schevchenko

extension yii2 widget dominus77 yii2-owl-carousel-2

09/10 2017

v1.0.2

1.0.2.0

Renders a Owl Carousel 2 widget for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexey Schevchenko

extension yii2 widget dominus77 yii2-owl-carousel-2

08/10 2017

v1.0.1

1.0.1.0

Renders a Owl Carousel 2 widget for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexey Schevchenko

extension yii2 widget dominus77 yii2-owl-carousel-2

08/10 2017

v1.0.0

1.0.0.0

Renders a Owl Carousel 2 widget for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexey Schevchenko

extension yii2 widget dominus77 yii2-owl-carousel-2