m1roff/yii2-behavior-jsonfield

2.1.0 2024-08-22 20:41 UTC

This package is auto-updated.

Last update: 2024-10-22 20:56:57 UTC


README

Installation

The preferred way to install this extension is through composer.

Either run

composer require mirkhamidov/yii2-behavior-jsonfield "dev-master"

Configure

add behavior entry to you model

/** @inheritdoc */
public function behaviors() {
    return ArrayHelper::merge(parent::behaviors(), [
        'interestsJson' => [
            'class' => JsonFieldBehavior::class,
            'field' => 'interests',
        ],
        'languagesJson' => [
            'class' => JsonFieldBehavior::class,
            'field' => 'languages',
        ],
    ]);
}