PHPackages                             netis/yii2-fsm - 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. [Framework](/categories/framework)
4. /
5. netis/yii2-fsm

ActiveYii2-extension[Framework](/categories/framework)

netis/yii2-fsm
==============

Extensions to the Yii PHP framework providing tools for switching status of an AR model.

2147PHP

Since Dec 16Pushed 9y ago3 watchersCompare

[ Source](https://github.com/netis-pl/yii2-fsm)[ Packagist](https://packagist.org/packages/netis/yii2-fsm)[ RSS](/packages/netis-yii2-fsm/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

niix-fsm
========

[](#niix-fsm)

Extensions to the Yii PHP framework providing tools for switching status of a model.

Provides:

- a controller action with a view to perform status transitions
- a model behavior to bind custom logic to status transitions
- a controller method to build a menu
- state graph configuration

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

[](#installation)

Currently, the repository is private, so add it manually to the composer.json file:

```
  "require": {
    "netis/yii2-fsm": "dev-master"
  },
```

add alias to config `    'aliases' => [ '@netis' => '@vendor/netis', ],`

Usage
-----

[](#usage)

```
    run example `./yii fsm/create  "\netis\assortment\models\Product" "application_status_changes" "productPricings"`
```

- Implement the `IStateful` interface in selected AR model. You might want to add `Yii::import('fsm.components.*')` at the top of the file.
- Adjust rules to remove attributes from the `transition` scenario. The `NetActiveRecord.filterRules()` helper method should be used for that.
- In the controller, add the `state` action and include it in the context menu, adjust according to comments:

```
    public function actions()
    {
        return array(
            'state'=>array(
                'class'=>'fsm.components.StateAction',
                'updateAuthItem' => 'update Model', // adjust here, insert AR model name
                'isAdminCallback' => array('NetController', 'isAdmin'),
            ),
        );
    }

    protected function buildNavigation(CAction $action, NetActiveRecord $model, $readOnly = false, $horizontal = true)
    {
        $result = parent::buildNavigation($action, $model, $readOnly, $horizontal);
        if ($horizontal || $model->primaryKey !== null) {
            Yii::import('fsm.components.StateAction');
            $transitions = $model->getTransitionsGroupedByTarget();
            $this->menu[] = StateAction::getContextMenuItem($action, $transitions, $model, $model->status_id, self::isAdmin()); // adjust status column
        }
        return $result;
    }
```

Todo
----

[](#todo)

- group state transition logic into named workflows

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 72% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/795177?v=4)[Jan Waś](/maintainers/nineinchnick)[@nineinchnick](https://github.com/nineinchnick)

---

Top Contributors

[![pradziszewski123](https://avatars.githubusercontent.com/u/10596959?v=4)](https://github.com/pradziszewski123 "pradziszewski123 (18 commits)")[![nineinchnick](https://avatars.githubusercontent.com/u/795177?v=4)](https://github.com/nineinchnick "nineinchnick (6 commits)")[![mozarcik](https://avatars.githubusercontent.com/u/1579480?v=4)](https://github.com/mozarcik "mozarcik (1 commits)")

### Embed Badge

![Health badge](/badges/netis-yii2-fsm/health.svg)

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

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k104.3M836](/packages/laravel-socialite)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k38.6M289](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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