PHPackages                             emidia/yii2-jsonify - 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. emidia/yii2-jsonify

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

emidia/yii2-jsonify
===================

Behavior that convert array to JSON before save data in model

v1.0(10y ago)0543MITPHP

Since Sep 25Pushed 10y ago5 watchersCompare

[ Source](https://github.com/emidia/yii2-jsonify)[ Packagist](https://packagist.org/packages/emidia/yii2-jsonify)[ RSS](/packages/emidia-yii2-jsonify/feed)WikiDiscussions master Synced 2d ago

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

Yii2 JSONify
============

[](#yii2-jsonify)

Behavior that convert array to JSON before save data in model

Install
-------

[](#install)

Install via composer

```
composer require emidia/yii2-jsonify
```

Or you may add dependency manually in composer.json:

```
 "emidia/yii2-jsonify": "*"

```

How to use
----------

[](#how-to-use)

To use JsonifyBehavior, insert the following code to your ActiveRecord class:

```
use emidia\yii2\JsonifyBehavior;
public function behaviors()
{
    return [
        JsonifyBehavior::className(),
    ];
}
```

By default JsonifyBehavior fill `json_data` attribute from array into a json encoded string

If your attribute names are different, you may configure the \[\[attribute\]\] properties like the following:

```
public function behaviors()
{
    return [
        [
            'class' => JsonifyBehavior::className(),
            'attribute' => 'data',
        ],
    ];
}
```

So, if set an array in model's attribute, this behavior will convert all data to JSON

```
$model->setAttributes([
  'data' => [
    'id'=> 12,
    'title' => 'test'
  ]
]);
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

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

Unknown

Total

1

Last Release

3935d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/36ddae2f087bd4c4c1863b65386bc6f3256cc78ae125fd76bf9c33ba73f1bde6?d=identicon)[rzani](/maintainers/rzani)

---

Top Contributors

[![rzani](https://avatars.githubusercontent.com/u/684192?v=4)](https://github.com/rzani "rzani (6 commits)")

### Embed Badge

![Health badge](/badges/emidia-yii2-jsonify/health.svg)

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

###  Alternatives

[w3c/website-templates-bundle

W3C Website Templates

816.1k](/packages/w3c-website-templates-bundle)[ck/file_marc_reference

MARCspec adapter for File\_MARC

1074.2k1](/packages/ck-file-marc-reference)[joy2362/php-time-zone

A simple package that provide list of all timezone that php support

172.3k](/packages/joy2362-php-time-zone)

PHPackages © 2026

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