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
2 github stars & 0 github forks
0 downloads in the last day
101 downloads in the last 30 days
2909 total downloads