ipaya / yii2-serializers
There is no license information available for the latest version (0.1.0) of this package.
The serializers extension for Yii2.
0.1.0
2017-05-26 15:35 UTC
Requires
- php: >=5.4.0
- yiisoft/yii2: *
Requires (Dev)
- phpunit/phpunit: >4.8.20 <6.0
This package is auto-updated.
Last update: 2024-10-26 14:34:15 UTC
README
序列化类
安装
使用 composer 安装:
使用命令
php composer.phar require --prefer-dist ipaya/yii2-serializers
或在 composer.json
文件的 require
段增加如下代码
"ipaya/yii2-serializers": "*"
使用
<?php $model = new User(); $serializer = new JsonSerializer(); // 将对象序列化为字符串 $json = $serializer->serialize($model); // 将字符串反序列话为对象 $user = $serializer->unserializ($json);