mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 15:12:48 +08:00
View类的fetch方法 在关闭response自动输出的情况下 直接输出 controller类增加display方法作为fetch的别名方法
This commit is contained in:
@@ -92,6 +92,19 @@ class Controller
|
||||
return $this->view->fetch($template, $vars, $config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载模板和页面输出 可以返回输出内容
|
||||
* @access public
|
||||
* @param string $template 模板文件名
|
||||
* @param array $vars 模板输出变量
|
||||
* @param array $config 模板参数
|
||||
* @return mixed
|
||||
*/
|
||||
public function display($template = '', $vars = [], $config = [])
|
||||
{
|
||||
return $this->view->fetch($template, $vars, $config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 渲染内容输出
|
||||
* @access public
|
||||
|
||||
@@ -186,6 +186,10 @@ class View
|
||||
$replace = $this->config['parse_str'];
|
||||
$content = str_replace(array_keys($replace), array_values($replace), $content);
|
||||
}
|
||||
if (!Config::get('response_auto_output')) {
|
||||
// 自动响应输出
|
||||
return Response::send($content, Response::type());
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user