PHPackages                             macklus/yii2-metadatabehavior - 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. macklus/yii2-metadatabehavior

ActiveYii2-behavior

macklus/yii2-metadatabehavior
=============================

Simple behavior to use json-like fields on bbdd

1.0.1(10y ago)139Apache-2.0PHP

Since Feb 24Pushed 10y ago2 watchersCompare

[ Source](https://github.com/macklus/yii2-metadatabehavior)[ Packagist](https://packagist.org/packages/macklus/yii2-metadatabehavior)[ RSS](/packages/macklus-yii2-metadatabehavior/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

yii2-metadatabehavior
=====================

[](#yii2-metadatabehavior)

MetaDataBehavior allow to use one TEXT field on a database as a json data To use MetaDataBehavior, simply add this behavior into your behaviors model function

```
use macklus\MetaDataBehavior\MetaDataBehavior;

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

Your model table should have a TEXT field named as attribute property

Then, in your controller, you can user getMetaData(keyword,default) and setMetaData(keyword, value)

```
$model = MyModel::find()->where(['id' => 1])->one();
$model->setMetaData('keyword1','value1');
$model->setMetaData('otherkeyword','anothervalue');

// Other stuff
echo $model->getMetaData('keyword1');

@author José Pedro Andrés
@since 2.0Yii2 MetaData Behavior
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity64

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

Every ~51 days

Total

2

Last Release

3679d ago

### Community

Maintainers

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

---

Top Contributors

[![macklus](https://avatars.githubusercontent.com/u/3457708?v=4)](https://github.com/macklus "macklus (5 commits)")

---

Tags

yii2extensionBehavior

### Embed Badge

![Health badge](/badges/macklus-yii2-metadatabehavior/health.svg)

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

###  Alternatives

[omgdef/yii2-multilingual-behavior

Port of the yii-multilingual-behavior for yii

143174.9k9](/packages/omgdef-yii2-multilingual-behavior)[lav45/yii2-translated-behavior

This extension allows you to quickly and simple enough to add translations for any ActiveRecord models.

3742.2k](/packages/lav45-yii2-translated-behavior)[mdmsoft/yii2-autonumber

Auto number extension for the Yii framework

1830.9k](/packages/mdmsoft-yii2-autonumber)[valentinek/yii2-closure-table-behavior

This extension allows you to get functional for closure table trees.

1615.3k](/packages/valentinek-yii2-closure-table-behavior)[v0lume/yii2-meta-tags

DB based model meta data for SEO

204.1k](/packages/v0lume-yii2-meta-tags)[liyunfang/yii2-upload-behavior

Upload behavior for Yii 2

161.7k](/packages/liyunfang-yii2-upload-behavior)

PHPackages © 2026

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