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