改进Response类 支持扩展不同的输出类型 改进Model类 不同的模型采用不同的查询对象实例 修正Request类一处错误 助手函数view改进 直接返回Response类对象实例

This commit is contained in:
thinkphp
2016-05-16 14:18:47 +08:00
parent 891c1f99f2
commit 199825ec32
15 changed files with 420 additions and 212 deletions

View File

@@ -106,7 +106,7 @@ class App
default:
throw new Exception('dispatch type not support', 10008);
}
} catch (HttpResponseException $exception){
} catch (HttpResponseException $exception) {
$data = $exception->getResponse();
}
// 输出数据到客户端
@@ -116,8 +116,9 @@ class App
} else {
// 监听app_end
APP_HOOK && Hook::listen('app_end', $data);
$type = IS_AJAX ? Config::get('default_ajax_return') : Config::get('default_return_type');
// 自动响应输出
return Response::instance()->send($data, '', Config::get('response_return'));
return Response::create($type)->send($data);
}
}
}