PHPackages                             nox-it/yii2-nox-behaviors - 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. nox-it/yii2-nox-behaviors

AbandonedLibrary[Framework](/categories/framework)

nox-it/yii2-nox-behaviors
=========================

Yii2 nyx Behaviors

2.0.0(6y ago)17BSD-3-ClausePHPPHP &gt;=7.4.0

Since May 30Pushed 3y ago2 watchersCompare

[ Source](https://github.com/nyx-solutions/yii2-nyx-behaviors)[ Packagist](https://packagist.org/packages/nox-it/yii2-nox-behaviors)[ RSS](/packages/nox-it-yii2-nox-behaviors/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (7)Used By (0)

Yii PHP Framework Version 2 / NYX Behaviors
===========================================

[](#yii-php-framework-version-2--nyx-behaviors)

Collection of useful behaviors for Yii Framework 2.0 (at the present there is only one behavior, the `datetime` behavior.).

[![Latest Stable Version](https://camo.githubusercontent.com/f5084cfb408fb568cddb753247672fc2f0fa266b3c5ab454cc6855040fd35736/68747470733a2f2f706f7365722e707567782e6f72672f6e79782d736f6c7574696f6e732f796969322d6e79782d6265686176696f72732f762f737461626c65)](https://packagist.org/packages/nyx-solutions/yii2-nyx-behaviors)[![Total Downloads](https://camo.githubusercontent.com/bcbf949aa8e96c5dd07301751563266fbd7f60f47a7e14e15a183bd5a9c8f58a/68747470733a2f2f706f7365722e707567782e6f72672f6e79782d736f6c7574696f6e732f796969322d6e79782d6265686176696f72732f646f776e6c6f616473)](https://packagist.org/packages/nyx-solutions/yii2-nyx-behaviors)[![Latest Unstable Version](https://camo.githubusercontent.com/af636f68084fcf1fc7310e54212910ab03ef2d5ad3b12f930d6d6f997185ce65/68747470733a2f2f706f7365722e707567782e6f72672f6e79782d736f6c7574696f6e732f796969322d6e79782d6265686176696f72732f762f756e737461626c65)](https://packagist.org/packages/nyx-solutions/yii2-nyx-behaviors)[![License](https://camo.githubusercontent.com/42387c81ccfea32712b8af79521743453c7ec8f05826653a51eb1dc9c8b54a13/68747470733a2f2f706f7365722e707567782e6f72672f6e79782d736f6c7574696f6e732f796969322d6e79782d6265686176696f72732f6c6963656e7365)](https://packagist.org/packages/nyx-solutions/yii2-nyx-behaviors)[![Monthly Downloads](https://camo.githubusercontent.com/e674b0dee38ec528065d04cfa3408ef9e7422c4907e784791a217e3ea4840467/68747470733a2f2f706f7365722e707567782e6f72672f6e79782d736f6c7574696f6e732f796969322d6e79782d6265686176696f72732f642f6d6f6e74686c79)](https://packagist.org/packages/nyx-solutions/yii2-nyx-behaviors)[![Daily Downloads](https://camo.githubusercontent.com/fe07ec69c46fe68e5181ddc09625d2c2a6ac3cfd446cf51c61da2f2d78e85f00/68747470733a2f2f706f7365722e707567782e6f72672f6e79782d736f6c7574696f6e732f796969322d6e79782d6265686176696f72732f642f6461696c79)](https://packagist.org/packages/nyx-solutions/yii2-nyx-behaviors)[![composer.lock](https://camo.githubusercontent.com/643db1f66f327c051bf7fabb078f14a8db0a691e508c0855192270ba8b951142/68747470733a2f2f706f7365722e707567782e6f72672f6e79782d736f6c7574696f6e732f796969322d6e79782d6265686176696f72732f636f6d706f7365726c6f636b)](https://packagist.org/packages/nyx-solutions/yii2-nyx-behaviors)

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist nyx-solutions/yii2-nyx-behaviors "*"
```

or add

```
"nyx-solutions/yii2-nyx-behaviors": "*"

```

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

Usage
-----

[](#usage)

In your base ActiveRecord Model you can add the following `behaviors` method:

```
namespace common\models;

use \yii\helpers\ArrayHelper;

/**
 * Class ActiveRecordModel
 *
 * @package common\models
 */
class ActiveRecordModel extends \yii\db\ActiveRecord
{
    #region Behaviors
    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        $behaviors = [];

        if ($this->hasAttribute('createdAt') && $this->hasAttribute('updatedAt')) {
            $behaviors['datetime'] = [
                'class'      => \nyx\behaviors\DateTimeBehavior::className(),
                'attributes' => [
                    ActiveRecord::EVENT_BEFORE_INSERT => ['createdAt', 'updatedAt'],
                    ActiveRecord::EVENT_BEFORE_UPDATE => 'updatedAt'
                ]
            ];
        }

        return ArrayHelper::merge(parent::behaviors(), $behaviors);
    }
    #endregion
}
```

License
-------

[](#license)

**yii2-nyx-behaviors** is released under the BSD 3-Clause License. See the bundled `LICENSE.md` for details.

[![Yii2](https://camo.githubusercontent.com/d6b0929173e28cc627430d2519ca1853466a70f37395877eaf4820cb3e1e1909/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f77657265645f62792d5969695f4672616d65776f726b2d677265656e2e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/d6b0929173e28cc627430d2519ca1853466a70f37395877eaf4820cb3e1e1909/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f77657265645f62792d5969695f4672616d65776f726b2d677265656e2e7376673f7374796c653d666c6174)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 57.1% 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 ~477 days

Total

4

Last Release

2201d ago

Major Versions

1.0.2 → 2.0.02020-05-02

PHP version history (2 changes)1.0.0PHP &gt;=5.4.0

2.0.0PHP &gt;=7.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/7d2a5aa9318b01f0f61f80d6ae5f443132975f280e0dffb86bcd0ff658c59a56?d=identicon)[jsas-development](/maintainers/jsas-development)

---

Top Contributors

[![jsas4coding](https://avatars.githubusercontent.com/u/4156892?v=4)](https://github.com/jsas4coding "jsas4coding (4 commits)")[![brenoherculano](https://avatars.githubusercontent.com/u/90738807?v=4)](https://github.com/brenoherculano "brenoherculano (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

phpframeworkbehaviorsyii2extension

### Embed Badge

![Health badge](/badges/nox-it-yii2-nox-behaviors/health.svg)

```
[![Health](https://phpackages.com/badges/nox-it-yii2-nox-behaviors/health.svg)](https://phpackages.com/packages/nox-it-yii2-nox-behaviors)
```

PHPackages © 2026

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