kv4nt/yii2-owl-carousel2

A Yii2 widget for owl carousel 2

Maintainers

👁 kv4nt

Package info

github.com/kv4nt/yii2-owl-carousel2

Type:yii2-extension

pkg:composer/kv4nt/yii2-owl-carousel2

Statistics

Installs: 116 855

Dependents: 6

Suggesters: 0

Stars: 7

Open Issues: 0

v1.0.5 2022-07-20 08:31 UTC

Requires

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 8bae09c53c35df81876e30ab802ba3a4cf546f40

  • Victor Shumeyko <kvant90.woop@gmail.com>

extensioncarouselyii2owlowlcarouselowlcarousel2yii2-owl-carouselyii2 carouselyii2 owl carouselyii2 owlcarouselyii2 owl

This package is auto-updated.

Last update: 2026-06-20 23:01:16 UTC


README

The OwlCarouselWidget is a Yii2 wrapper for the [Owl Carousel 2] (https://owlcarousel2.github.io/OwlCarousel2/)

👁 Latest Stable Version
👁 Total Downloads

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist kv4nt/yii2-owl-carousel2 "*"

or add

"kv4nt/yii2-owl-carousel2": "*"

to the require section of your composer.json file.

Plugin options

see at https://owlcarousel2.github.io/OwlCarousel2/docs/api-options.html

Usage

Once the extension is installed, simply use it in your code by :

<?php
use kv4nt\owlcarousel\OwlCarouselWidget;

OwlCarouselWidget::begin([
 'container' => 'div',
 'assetType' => OwlCarouselWidget::ASSET_TYPE_CDN,
 'jqueryFunction' => 'jQuery',// or $
 'containerOptions' => [
 'id' => 'container-id',
 'class' => 'container-class owl-theme'
 ],
 'pluginOptions' => [
 'autoplay' => true,
 'autoplayTimeout' => 3000,
 'items' => 3,
 'loop' => true,
 'itemsDesktop' => [1199, 3],
 'itemsDesktopSmall' => [979, 3]
 ]
]);
?>

<div class="item-class"><img src="/img/1.jpg" alt="Image 1"></div>
<div class="item-class"><img src="/img/2.jpg" alt="Image 2"></div>
<div class="item-class"><img src="/img/3.jpg" alt="Image 3"></div>
<div class="item-class"><img src="/img/4.jpg" alt="Image 4"></div>


<?php OwlCarouselWidget::end(); ?>