添加数据转换类及相关驱动

This commit is contained in:
麦当苗儿
2013-04-19 13:57:42 +08:00
parent 55ed785d7a
commit 828ae2d18c
3 changed files with 149 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<?php
// +----------------------------------------------------------------------
// | TOPThink [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2011 http://topthink.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi.cn@gmail.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------
namespace Think\Transform\Driver;
class Json{
public function encode($data){
return json_encode($data);
}
public function decode($data, $assoc = true){
return json_decode($data, $assoc);
}
}