Use optionally separate folder for views (thanks @Scrollog for idea)

This commit is contained in:
slawkens 2025-05-09 13:38:48 +02:00
parent 2fece725a4
commit 03e2752139

View File

@ -136,6 +136,11 @@ if($forumSetting != '')
$twig->addGlobal('template_name', $template_name); $twig->addGlobal('template_name', $template_name);
$twig->addGlobal('template_path', $template_path); $twig->addGlobal('template_path', $template_path);
if($twig_loader) { if($twig_loader) {
$viewsPath = BASE . $template_path . '/views';
if (is_dir($viewsPath)) {
$twig_loader->prependPath($viewsPath);
}
$twig_loader->prependPath(BASE . $template_path); $twig_loader->prependPath(BASE . $template_path);
} }