冻痕 / yii2-array-field
允许您在属性中存储数组的特性
v1.0.2
2015-11-11 13:25 UTC
Requires
- php: >=5.4.0
- yiisoft/yii2: ~2.0
This package is not auto-updated.
Last update: 2024-09-14 18:04:08 UTC
README
这个 Yii2 模型行为允许您在属性中存储数组。
安装
运行以下 Composer 命令以安装最新稳定版本
composer require frostealth/yii2-array-field @stable
使用方法
只需将行为附加到您的模型即可。
use frostealth\yii2\behaviors\ArrayFieldBehavior; public function behaviors() { return [ [ 'class' => ArrayFieldBehavior::className(), 'attributes' => ['attribute1', 'attribute2'], // 'defaultEncodedValue' => null, // 'defaultDecodedValue' => [], ], ]; }
许可证
MIT 许可证(MIT)。更多信息请见 LICENSE.md。