response类增加create方法 改进think\response\redirect类 改进助手函数和traits\controller\Jump

This commit is contained in:
thinkphp
2016-05-17 11:17:24 +08:00
parent df96d049b9
commit 92d999b484
6 changed files with 73 additions and 76 deletions

View File

@@ -117,12 +117,7 @@ class App
// 监听app_end
APP_HOOK && Hook::listen('app_end', $data);
$type = IS_AJAX ? Config::get('default_ajax_return') : Config::get('default_return_type');
if (in_array(strtolower($type), ['json', 'jsonp', 'xml'])) {
$class = '\\think\\response\\' . ucfirst($type);
} else {
$class = '\\think\\Response';
}
return (new $class($data, $type))->send();
return Response::create($data, $type)->send();
}
}
}