PHPackages                             sjaakp/yii2-cycle2 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sjaakp/yii2-cycle2

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

sjaakp/yii2-cycle2
==================

Cycle2 jQuery slide show for Yii 2.0

0.9.2(1y ago)48101[3 issues](https://github.com/sjaakp/yii2-cycle2/issues)MITPHP

Since Dec 12Pushed 1y ago2 watchersCompare

[ Source](https://github.com/sjaakp/yii2-cycle2)[ Packagist](https://packagist.org/packages/sjaakp/yii2-cycle2)[ RSS](/packages/sjaakp-yii2-cycle2/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

yii2-cycle2
===========

[](#yii2-cycle2)

#### Cycle2 jQuery slide show for Yii 2.0

[](#cycle2-jquery-slide-show-for-yii-20)

[![Latest Stable Version](https://camo.githubusercontent.com/b62ee67cab924fbd405c37b5d86f95c377814d86be3845cb1a3c89d93acbe578/68747470733a2f2f706f7365722e707567782e6f72672f736a61616b702f796969322d6379636c65322f762f737461626c65)](https://packagist.org/packages/sjaakp/yii2-cycle2)[![Total Downloads](https://camo.githubusercontent.com/f06fb0921e79e6a7b1ac9aa0a017847385edc297804651b1b7c67dfa997b577a/68747470733a2f2f706f7365722e707567782e6f72672f736a61616b702f796969322d6379636c65322f646f776e6c6f616473)](https://packagist.org/packages/sjaakp/yii2-cycle2)[![License](https://camo.githubusercontent.com/342730fadae5e25d5486adbf443460a48512dfedd6f798a1bea108fd81b5d97b/68747470733a2f2f706f7365722e707567782e6f72672f736a61616b702f796969322d6379636c65322f6c6963656e7365)](https://packagist.org/packages/sjaakp/yii2-cycle2)

**yii2-cycle2** is a widget to render the excellent [Cycle2](http://jquery.malsup.com/cycle2/) jQuery slideshow widget in the [Yii 2.0](http://www.yiiframework.com/ "Yii") PHP Framework. Like a [GridView](http://www.yiiframework.com/doc-2.0/yii-grid-gridview.html "Yii"), its data is fed from an [ActiveDataProvider](http://www.yiiframework.com/doc-2.0/yii-data-activedataprovider.html "Yii") (or, more generally, from a class derived from [BaseDataProvider](http://www.yiiframework.com/doc-2.0/yii-data-basedataprovider.html "Yii")).

A demonstration of **Yii2-cycle2** is [here](http://www.sjaakpriester.nl/software/cycle).

Installation
------------

[](#installation)

Install **yii2-cycle2** with [Composer](https://getcomposer.org/). Either add the following to the require section of your `composer.json` file:

`"sjaakp/yii2-cycle2": "*"`

Or run:

`composer require sjaakp/yii2-cycle2 "*"`

You can manually install **yii2-cycle2** by [downloading the source in ZIP-format](https://github.com/sjaakp/yii2-cycle2/archive/master.zip).

Using yii2-cycle2
-----------------

[](#using-yii2-cycle2)

**yii2-cycle2** implements a widget of the class `Cycle`. It gets its data from an `ActiveDataProvider`, `ArrayDataProvider`, or other class derived from [`BaseDataProvider`](http://www.yiiframework.com/doc-2.0/yii-data-basedataprovider.html "Yii") Using it is not unlike using a [GridView](http://www.yiiframework.com/doc-2.0/yii-grid-gridview.html "Yii Framework"). For instance, in the Controller you might have something like:

```

```

To render a `Cycle` in the `View` we could use:

```

...

...

```

Options
-------

[](#options)

`Cycle` has the following options:

### dataProvider

[](#dataprovider)

The data provider for the widget. This property is required. In most cases, it will be an `ActiveDataProvider` or an `ArrayDataProvider`.

### imgAttribute

[](#imgattribute)

Image attribute, required.

- `string`: name of the attribute that holds the source URL for the slide image. Note that this could be a virtual attribute.
- `callable`: a callable with signature `function($model, $widget)` that returns the source URL for the slide image.

### urlAttribute

[](#urlattribute)

Link URL attribute, optional.

- `null`: the slides are not embedded in links (default).
- `string`: name of the attribute that holds the link URL for the slide. Note that this could be a virtual attribute.
- `callable`: a callable with signature `function($model, $widget)` that returns the link URL for the slide.

### tooltipAttribute

[](#tooltipattribute)

Tooltip attribute, optional.

- `null`: the slides don't have tooltips (default).
- `string`: name of the attribute that holds the text or HTML for the slide tooltip. Note that this could be a virtual attribute.
- `callable`: a callable with signature `function($model, $widget)` that returns the text or HTML for the slide tooltip.

### captionAttributes, overlayAttributes

[](#captionattributes-overlayattributes)

The attributes displayed in the caption or the overlay. See the [Cycle2 documentation](http://jquery.malsup.com/cycle2/demo/caption.php "Cycle2").

Members can be:

- `string` name of the attribute holding the text or HTML for the caption or overlay element;
- ` => ` where `` is a name and `` is
    - the name of the attribute;
    - or a callable with the signature `function($model, $widget)` returning the text or HTML.

The attribute values will be rendered inside Cycle's caption or overlay `div`, each inside its own `span` element with class `"slide-"`.

### content

[](#content)

Extra elements in the Cycle container, apart from the slides, caption, and overlay. Could be filled with elements like `''` (see: [Cycle2 pagers](http://jquery.malsup.com/cycle2/demo/pager.php "Cycle2")).

### plugins

[](#plugins)

Plugins for the Cycle2 jQuery widget. **Notice** that **yii2-cycle2** attempts to load the required plugins automatically.

### options

[](#options-1)

Client options for the underlying [Cycle2 jQuery](http://jquery.malsup.com/cycle2/api/#options "Cycle2") widget. **Notice** that the option names must be camelCased.

### htmlOptions

[](#htmloptions)

HTML options of the `Cycle` container. Use this if you want to explicitly set the `ID`.

### slideOptions

[](#slideoptions)

HTML options for each slide. One use would be to set this to: `[ 'target' => '_blank' ]`

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1561 days

Total

3

Last Release

727d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/156f636aceedc73021a2bfafb5433271c2c55d6cf4bce06b12902c85b4b491f1?d=identicon)[sjaakp](/maintainers/sjaakp)

---

Top Contributors

[![sjaakp](https://avatars.githubusercontent.com/u/5585878?v=4)](https://github.com/sjaakp "sjaakp (5 commits)")

---

Tags

yii2extensionwidgetyiicycleslidesslideshow

### Embed Badge

![Health badge](/badges/sjaakp-yii2-cycle2/health.svg)

```
[![Health](https://phpackages.com/badges/sjaakp-yii2-cycle2/health.svg)](https://phpackages.com/packages/sjaakp-yii2-cycle2)
```

###  Alternatives

[sjaakp/yii2-taggable

Manage tags of ActiveRecord in Yii2.

3031.8k](/packages/sjaakp-yii2-taggable)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
