PHPackages                             inspirenmy/yii2-traits - 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. inspirenmy/yii2-traits

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

inspirenmy/yii2-traits
======================

Yii2 traits library

v1.2.3(8y ago)09562MITPHPPHP &gt;5.5.0

Since Aug 22Pushed 8y agoCompare

[ Source](https://github.com/inspirenmy/yii2-traits)[ Packagist](https://packagist.org/packages/inspirenmy/yii2-traits)[ Docs](https://github.com/inspirenmy/yii2-traits)[ RSS](/packages/inspirenmy-yii2-traits/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (2)Versions (10)Used By (2)

\#Yii2 traits library ##Description Yii2 traits library which used in web-application development.

\##Composition ###AjaxValidationTrait

Trait add perform ajax validation to models and forms.

\#####Usage:

use [inspirenmy\\models\\Model](https://github.com/inspirenmy/yii2-models) as parent or set in you model

```
use AjaxValidationTrait;
```

in controller

```
if (!is_null($validate = $model->performAjaxValidation()))
            return $validate;
```

\###ConstantTrait

Trait generates array of class constant labels or one label by constant value

\#####Usage:

set in your model

```
use ConstantTrait;

const NAME_FIRST = 1;
const NAME_SECOND = 2;
```

then anywhere get array values and names of constants:

```
ModelName::getName();   // returns array(1 => 'First', 2 => 'Second');
```

or

```
$model->getName();      // returns array(1 => 'First', 2 => 'Second');
```

Whether get name by constant value:

```
ModelName::getName(ModelName::NAME_FIRST);   // returns 'First';
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 70% 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 ~49 days

Recently: every ~87 days

Total

9

Last Release

3156d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/508c408b4d48fec6fccb653e0089bd833d1b7026f8cb6c2a871df8d71756f804?d=identicon)[inspirenmy](/maintainers/inspirenmy)

---

Top Contributors

[![demmonico](https://avatars.githubusercontent.com/u/10497315?v=4)](https://github.com/demmonico "demmonico (7 commits)")[![mlaxwong](https://avatars.githubusercontent.com/u/11769661?v=4)](https://github.com/mlaxwong "mlaxwong (3 commits)")

---

Tags

traityii2extensionyiicomponent

### Embed Badge

![Health badge](/badges/inspirenmy-yii2-traits/health.svg)

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

###  Alternatives

[skeeks/cms

SkeekS CMS — control panel and tools based on php framework Yii2

13825.6k47](/packages/skeeks-cms)

PHPackages © 2026

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