Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 671 Bytes

README.md

File metadata and controls

36 lines (27 loc) · 671 Bytes

Behavior for JSON field

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',
        ],
    ]);
}