frostealth/yii2-array-field

Behavior that allows you to store arrays in attributes

Installs: 8 401

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 2

Open Issues: 1

Type:yii2-extension

v1.0.2 2015-11-11 13:25 UTC

This package is not auto-updated.

Last update: 2024-04-13 15:39:20 UTC


README

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.