eee
This commit is contained in:
@@ -299,9 +299,7 @@ class BladeCompiler
|
||||
}
|
||||
|
||||
// 替换剩余的 @yield 为空
|
||||
$layoutContent = preg_replace('/@yield\s*\([\'"](.+?)[\'"]\)/', '', $layoutContent);
|
||||
|
||||
return $layoutContent;
|
||||
return preg_replace('/@yield\s*\([\'"](.+?)[\'"]\)/', '', $layoutContent);
|
||||
}
|
||||
|
||||
// 处理 @section ... @endsection (非继承模式,用于组件等)
|
||||
@@ -324,9 +322,7 @@ class BladeCompiler
|
||||
}, $content);
|
||||
|
||||
// 处理 @parent(在 section 中使用)
|
||||
$content = preg_replace('/@parent/', '', $content);
|
||||
|
||||
return $content;
|
||||
return preg_replace('/@parent/', '', $content);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -348,6 +344,8 @@ class BladeCompiler
|
||||
$data = eval("return [{$dataStr}];");
|
||||
$dataCode = var_export($data, true);
|
||||
} catch (\Throwable $e) {
|
||||
\Kiri::getLogger()->json_log($e);
|
||||
|
||||
$dataCode = '[]';
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -61,6 +61,9 @@ class BladeView
|
||||
require $compiledPath;
|
||||
} catch (\Throwable $e) {
|
||||
ob_end_clean();
|
||||
|
||||
\Kiri::getLogger()->json_log($throwable);
|
||||
|
||||
throw new \RuntimeException("视图渲染失败: {$this->view}", 0, $e);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user