frostealth/yii2-array-field Behavior that allows you to store arrays in attributes

behaviorjsonarrayattribute

Yii2 Array Field Behavior

This Yii2 model behavior allows you to store arrays in attributes.

Installation

Run the Composer command to install the latest stable version:

composer require frostealth/yii2-array-field @stable

Usage

Just attach the behavior to your model.

use frostealth\yii2\behaviors\ArrayFieldBehavior;

public function behaviors()
{
    return [
        [
            'class' => ArrayFieldBehavior::className(),
            'attributes' => ['attribute1', 'attribute2'],
            // 'defaultEncodedValue' => null,
            // 'defaultDecodedValue' => [],
        ],
    ];
}

License

The MIT License (MIT). See LICENSE.md for more information.

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



v1.0.2 is the latest of 3 releases



MIT license
Stats
1 github stars & 2 github forks
11 downloads in the last day
168 downloads in the last 30 days
8257 total downloads