mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
模板渲染异常处理
This commit is contained in:
@@ -155,8 +155,13 @@ class View
|
||||
ob_implicit_flush(0);
|
||||
|
||||
// 渲染输出
|
||||
$method = $renderContent ? 'display' : 'fetch';
|
||||
$this->engine->$method($template, $vars, $config);
|
||||
try {
|
||||
$method = $renderContent ? 'display' : 'fetch';
|
||||
$this->engine->$method($template, $vars, $config);
|
||||
} catch (\Exception $e) {
|
||||
ob_clean();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
// 获取并清空缓存
|
||||
$content = ob_get_clean();
|
||||
|
||||
Reference in New Issue
Block a user