PHPackages                             sonkei/yii2-status - 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. sonkei/yii2-status

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

sonkei/yii2-status
==================

Status module for Yii2

v1.1(9y ago)0123BSD-3-Clause

Since Mar 1Pushed 9y ago1 watchersCompare

[ Source](https://github.com/urma94/yii2-status)[ Packagist](https://packagist.org/packages/sonkei/yii2-status)[ RSS](/packages/sonkei-yii2-status/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

sonkei/yii2-status
==================

[](#sonkeiyii2-status)

Yii2 statuses module. Good when object have a lot of statuses, like `is_active`, `banned`, `indexed`, `moderated`, etc.

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Creative Commons License](https://camo.githubusercontent.com/3a18a398ebf9c68728504c490308489eb6803705d9250b66950a2c53a3b36978/68747470733a2f2f692e6372656174697665636f6d6d6f6e732e6f72672f6c2f62792f342e302f38307831352e706e67)](http://creativecommons.org/licenses/by/4.0/)

`sonkei/yii2-status` is designed to work out of the box. It means that installation requires minimal steps. Only one configuration step should be taken and you are ready to use this module on your Yii2 website.

Installation:
-------------

[](#installation)

### 1. Download

[](#1-download)

`sonkei/yii2-status` can be installed using composer. Run following command to download and install `sonkei/yii2-status`:

```
composer require sonkei/yii2-status
```

### 2. Configure

[](#2-configure)

#### 1. Register module

[](#1-register-module)

In you project configuration register `sonkei/yii2-status` module

```
'modules' => [
    // ...
    'status' => [
        'class' => 'sonkei\status\Module'
    ]
    // ...
]
```

#### 2. Apply migration

[](#2-apply-migration)

Copy migrations that could be found in `vendor/sonkei/yii2-status/dist/migrations` and run yii2 migration tool. Or you can apply migration straight from vendor

```
yii migrate/up --migrationPath=@vendor/sonkei/yii2-status/dist/migrations
```

#### 3. Add relation to status linking table (object\_status) to your model

[](#3-add-relation-to-status-linking-table-object_status-to-your-model)

```
// ...
function getStatuses()
{
    return $this->hasMany(Status::className(), ['id' => 'status_id'])
        ->viaTable(ObjectStatus::tableName(), ['object_id' => 'id']);
}
// ...
```

#### 4. Add behavior to your model

[](#4-add-behavior-to-your-model)

```
// ...
function behaviors() {
    return [
        // ...
        [
            'class' => 'sonkei\status\behaviors\StatusableBehavior',
            'status_relation' => 'statuses' // The relation connecting statuses and your object
        ],
        // ...
    ];
}
// ...
```

#### 5. Configure statuses

[](#5-configure-statuses)

Configure available statuses within the module ()

#### 6. Use it

[](#6-use-it)

```
$user->addStatus(Status::getByStatusLabel('Заблокирован'))
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~0 days

Total

2

Last Release

3359d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d65cab27fbedec35a0b54c0f20eeca9ca8c184ef2115dcc7f6b7f06457f7f3bf?d=identicon)[anuri73](/maintainers/anuri73)

---

Top Contributors

[![itzen](https://avatars.githubusercontent.com/u/8614041?v=4)](https://github.com/itzen "itzen (10 commits)")[![anuri73](https://avatars.githubusercontent.com/u/5062812?v=4)](https://github.com/anuri73 "anuri73 (5 commits)")

---

Tags

behaviormodulephpphp7statusyii2yii2status

### Embed Badge

![Health badge](/badges/sonkei-yii2-status/health.svg)

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

###  Alternatives

[brussens/yii2-maintenance-mode

Maintenance mode component for Yii framework 2.x.x version.

78256.3k5](/packages/brussens-yii2-maintenance-mode)[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)
