PHPackages                             yii2mod/yii2-toggle-column - 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. yii2mod/yii2-toggle-column

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

yii2mod/yii2-toggle-column
==========================

Provides a toggle data column and action

1.1(9y ago)37.9k1MITPHPPHP &gt;=5.6

Since Mar 3Pushed 8y ago1 watchersCompare

[ Source](https://github.com/yii2mod/yii2-toggle-column)[ Packagist](https://packagist.org/packages/yii2mod/yii2-toggle-column)[ RSS](/packages/yii2mod-yii2-toggle-column/feed)WikiDiscussions master Synced 1mo ago

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

 [ ![](https://avatars0.githubusercontent.com/u/993323) ](https://github.com/yiisoft)

Toggle Column Widget for Yii 2
==============================

[](#toggle-column-widget-for-yii-2)

Provides a toggle data column and action for Yii Framework 2.0

[![Latest Stable Version](https://camo.githubusercontent.com/57673a3f667187b9842425d93cf5af95b32badf413f6efab25991b23be2adf14/68747470733a2f2f706f7365722e707567782e6f72672f796969326d6f642f796969322d746f67676c652d636f6c756d6e2f762f737461626c65)](https://packagist.org/packages/yii2mod/yii2-toggle-column) [![Total Downloads](https://camo.githubusercontent.com/f6b1472d9d8738ca5594ee40c9364af6bb96e73392adef5329edd8a527156a1b/68747470733a2f2f706f7365722e707567782e6f72672f796969326d6f642f796969322d746f67676c652d636f6c756d6e2f646f776e6c6f616473)](https://packagist.org/packages/yii2mod/yii2-toggle-column) [![License](https://camo.githubusercontent.com/701df35166f0ac3b16d1303e0395fd05ca7e898ffaae6f06143780d9f95b12c8/68747470733a2f2f706f7365722e707567782e6f72672f796969326d6f642f796969322d746f67676c652d636f6c756d6e2f6c6963656e7365)](https://packagist.org/packages/yii2mod/yii2-toggle-column)[![Build Status](https://camo.githubusercontent.com/8a37b242361eb7ac63ba8f355005feac69d1e13c3e97cd40b8b63b1bf25abae5/68747470733a2f2f7472617669732d63692e6f72672f796969326d6f642f796969322d746f67676c652d636f6c756d6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/yii2mod/yii2-toggle-column)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist yii2mod/yii2-toggle-column "*"

```

or add

```
"yii2mod/yii2-toggle-column": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

1. In your GridView columns section:

```
[
    'class' => '\yii2mod\toggle\ToggleColumn',
    'attribute' => 'active',
],
```

2. Add `toggle action` to your controller as follows:

```
public function actions()
{
   return [
        'toggle' => [
            'class' => \yii2mod\toggle\actions\ToggleAction::class,
            'modelClass' => 'path\to\your\Model',
            // if you want to use flash messages
            'setFlash' => true,
            'flashSuccess' => 'Success message',
            'flashError' => 'Error message',
            'redirect' => 'some-redirect-url',
            // if you want to use custom code before saving the model
            'preProcess' => function() {
                // your custom code
            }
        ],
    ];
}
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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 ~1 days

Total

2

Last Release

3354d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a53a15e1548ce60ee92591e71492a39eaaecfc88eaa1a9d7f353d5c910381de?d=identicon)[disem](/maintainers/disem)

---

Top Contributors

[![arisk](https://avatars.githubusercontent.com/u/1027859?v=4)](https://github.com/arisk "arisk (6 commits)")[![dmitry-semenov](https://avatars.githubusercontent.com/u/17027799?v=4)](https://github.com/dmitry-semenov "dmitry-semenov (2 commits)")

---

Tags

yii2yii2-extensionyii2-grid-columnyii2-toggle-columnyii2extensiontogglecolumn

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/yii2mod-yii2-toggle-column/health.svg)

```
[![Health](https://phpackages.com/badges/yii2mod-yii2-toggle-column/health.svg)](https://phpackages.com/packages/yii2mod-yii2-toggle-column)
```

###  Alternatives

[pheme/yii2-toggle-column

Provides a toggle data column and action

27776.6k10](/packages/pheme-yii2-toggle-column)[kartik-v/yii2-widget-switchinput

A Yii2 wrapper widget for the Bootstrap Switch plugin to use checkboxes &amp; radios as toggle switchinputes (sub repo split from yii2-widgets)

384.4M13](/packages/kartik-v-yii2-widget-switchinput)[yiister/yii2-advanced-grid

Advanced GridView extension for Yii framework 2

4712.5k](/packages/yiister-yii2-advanced-grid)[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

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