mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
view助手函数增加replace参数 取消ViewResponse类的vars方法 使用assign方法替代
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user