sam-it/yii2-jsonbehavior
最新稳定版本:v2.0.0
Composer 安装命令:
composer require sam-it/yii2-jsonbehavior
包简介
Advanced AR JSON support
README 文档
README
Yii2 JsonBehavior
Work with JSON fields in Yii2
This behavior adds advanced support for working with JSON data in Yii AR models.
Use JSON fields like normal fields
Consider a model having a data attribute that is stored as JSON.
public function behaviors() {
return [
['class' => JsonBehavior::class, 'jsonAttributes' => ['data']]
];
}
// Examples:
$model = new Model();
$model->a = "test"; // If attribute 'a' does not exist this is stored inside the data.
$model->a['b'] = 'c']; // Nested arrays are supported.
$model->data = ['x' => 'y']; // Assigning directly is supported.
统计信息
- 总下载量: 18.38k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-09-18