PHPackages                             dhluther/yii2-swivel - 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. dhluther/yii2-swivel

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

dhluther/yii2-swivel
====================

A Yii 2.0 plugin to provide easy access and integration with zumba/swivel

3.0.3(3mo ago)325.0k↑66.7%2[1 issues](https://github.com/DanaLuther/yii2-swivel/issues)BSD-3-ClausePHPPHP ~8.0.0|~8.1.0|~8.2.0|~8.3.0|~8.4.0|~8.5.0CI failing

Since Mar 20Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/DanaLuther/yii2-swivel)[ Packagist](https://packagist.org/packages/dhluther/yii2-swivel)[ Docs](https://github.com/DanaLuther/yii2-swivel)[ RSS](/packages/dhluther-yii2-swivel/feed)WikiDiscussions 3.x Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (18)Used By (0)

Yii 2.0 Extension for Zumba ***Swivel***
========================================

[](#yii-20-extension-for-zumba-swivel)

This plugin provides the necessary elements for using Swivel in a Yii 2.0+ Application.

This plugin is based on the zumba/swivel-cake plugin.

### Configuration for Yii Component:

[](#configuration-for-yii-component)

```
 'swivel' => [
 	'class'=>'dhluther\swivel\SwivelComponent'
 ],
```

### Access from the application

[](#access-from-the-application)

```
// If the user has the feature behavior bucket enabled, use the testFeature.New.Something behavior,
// else use the default
Yii::$app->swivel->forFeature( 'testFeature' )
	->addBehavior('New.Something', [$this,'doSomethingB'], $args)
	->defaultBehavior([$this, 'doSomethingA'], $args )
	->execute();

// If the user has the feature behavior bucket enabled, use the first callable,
// else use the second callable (default)
Yii::$app->swivel->invoke('testFeature.New.Something', [$this,'doSomethingB'],[$this, 'doSomethingA']);
```

Make sure that your bootstrap file is set to properly include the composer autoloader.

In the index.php bootstrap:

```
require(__DIR__ . '/../vendor/autoload.php');
```

### Add the swivel migration namespace to your migration command config

[](#add-the-swivel-migration-namespace-to-your-migration-command-config)

```
'migrationNamespaces'=>[
    'dhluther\\swivel\\migrations'
]
```

with the alias of:

```
'@dhluther\swivel'=>'@vendor/dhluther/yii2-swivel/src'
```

If you've already migrated this package in the past and want to mark it to the current migratoin via namespace, the command is

```
./yii migrate/mark dhluther\\swivel\\migrations\\m190812_083802
```

### To add the composer vendor libraries for local development:

[](#to-add-the-composer-vendor-libraries-for-local-development)

```
docker run --rm -v $PWD:/app composer update
```

#### The ***Swivel*** Libraries

[](#the-swivel-libraries)

###  Health Score

56

—

FairBetter than 98% of packages

Maintenance73

Regular maintenance activity

Popularity32

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity89

Battle-tested with a long release history

 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 ~225 days

Recently: every ~240 days

Total

17

Last Release

111d ago

Major Versions

1.3.0 → 2.0.02021-07-30

2.0.2 → 3.0.0-rc12023-06-09

2.x-dev → 3.0.12023-12-22

PHP version history (7 changes)2.0.0PHP &gt;=7.4

2.0.1PHP ~7.4.0|~8.0.0|~8.1.0

2.0.2PHP ~7.4.0|~8.0.0|~8.1.0|~8.2.0

3.0.0-rc1PHP ~8.0.0|~8.1.0|~8.2.0

3.0.1PHP ~8.0.0|~8.1.0|~8.2.0|~8.3.0

3.0.2PHP ~8.0.0|~8.1.0|~8.2.0|~8.3.0|~8.4.0

3.0.3PHP ~8.0.0|~8.1.0|~8.2.0|~8.3.0|~8.4.0|~8.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/7b68873412d7e71cd7659be2123c914aee5f37f552fcd67832809bd0826fb39c?d=identicon)[DanaLuther](/maintainers/DanaLuther)

---

Top Contributors

[![DanaLuther](https://avatars.githubusercontent.com/u/285624?v=4)](https://github.com/DanaLuther "DanaLuther (37 commits)")

---

Tags

helperyii2extensionBehaviorcomponentswivel

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/dhluther-yii2-swivel/health.svg)

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

###  Alternatives

[sjaakp/yii2-taggable

Manage tags of ActiveRecord in Yii2.

3030.6k](/packages/sjaakp-yii2-taggable)[umanskyi31/opengraph

Created a new component for Yii2. The Open Graph component for your website

119.7k](/packages/umanskyi31-opengraph)

PHPackages © 2026

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