frostealth / yii2-array-field
Behavior that allows you to store arrays in attributes
Installs: 9 672
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 2
Open Issues: 1
Type:yii2-extension
Requires
- php: >=5.4.0
- yiisoft/yii2: ~2.0
This package is not auto-updated.
Last update: 2024-12-21 19:32:46 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.