Include functions.php

If there is functions.php inside themes root, include it.
This commit is contained in:
danpros 2024-01-24 11:22:54 +07:00
commit 5adfd66d50
4 changed files with 11 additions and 6 deletions

View file

@ -380,8 +380,13 @@ function render($view, $locals = null, $layout = null)
if (($view_root = config('views.root')) == null)
error(500, "[views.root] is not set");
$fnc = "{$view_root}/functions.php";
ob_start();
if (file_exists($fnc)) {
include $fnc;
}
include "{$view_root}/{$view}.html.php";
content(trim(ob_get_clean()));