view助手函数增加replace参数 取消ViewResponse类的vars方法 使用assign方法替代

This commit is contained in:
thinkphp
2016-07-20 12:20:38 +08:00
parent f3302d6e38
commit ab5dfcf111
3 changed files with 11 additions and 22 deletions

View File

@@ -421,12 +421,13 @@ if (!function_exists('view')) {
* 渲染模板输出
* @param string $template 模板文件
* @param array $vars 模板变量
* @param array $replace 模板替换
* @param integer $code 状态码
* @return \think\response\View
*/
function view($template = '', $vars = [], $code = 200)
function view($template = '', $vars = [], $replace = [], $code = 200)
{
return Response::create($template, 'view', $code)->vars($vars);
return Response::create($template, 'view', $code)->replace($replace)->assign($vars);
}
}