https://github.com/frostealth/yii2-array-field
Yii2 Array Field Behavior stores arrays in attributes
https://github.com/frostealth/yii2-array-field
attributes serialization yii2 yii2-behaviors yii2-extension
Last synced: 3 months ago
JSON representation
Yii2 Array Field Behavior stores arrays in attributes
- Host: GitHub
- URL: https://github.com/frostealth/yii2-array-field
- Owner: frostealth
- License: mit
- Created: 2015-06-20T21:08:06.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-27T10:30:06.000Z (over 9 years ago)
- Last Synced: 2025-01-31T20:55:52.451Z (4 months ago)
- Topics: attributes, serialization, yii2, yii2-behaviors, yii2-extension
- Language: PHP
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Yii2 Array Field Behavior
This Yii2 model behavior allows you to store arrays in attributes.
## Installation
Run the [Composer](http://getcomposer.org/download/) command to install the latest stable version:
```
composer require frostealth/yii2-array-field @stable
```## Usage
Just attach the behavior to your model.
```php
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](https://github.com/frostealth/yii2-array-field/blob/master/LICENSE.md) for more information.