改进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

@@ -50,7 +50,7 @@ trait Jump
$result = View::instance(Config::get('template'), Config::get('view_replace_str'))
->fetch(Config::get('dispatch_success_tmpl'), $result);
}
Response::instance()->send($result, $type);
return Response::create($type)->data($result);
}
/**
@@ -83,7 +83,7 @@ trait Jump
$result = View::instance(Config::get('template'), Config::get('view_replace_str'))
->fetch(Config::get('dispatch_error_tmpl'), $result);
}
Response::instance()->send($result, $type);
return Response::create($type)->data($result);
}
/**
@@ -97,7 +97,7 @@ trait Jump
*/
public function result($data, $code = 0, $msg = '', $type = '')
{
return Response::instance()->result($data, $code, $msg, $type);
return Response::create($type)->result($data, $code, $msg);
}
/**
@@ -109,7 +109,7 @@ trait Jump
*/
public function redirect($url, $params = [])
{
Response::instance()->redirect($url, $params);
Response::create()->isExit(true)->redirect($url, $params);
}
}