X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/19f1b5d2a1730f8e37c8fc5585d30b99e70a8575..966b9033d71b5226a3209658b81cec21024bd0b6:/www/www-header.php diff --git a/www/www-header.php b/www/www-header.php index 833fb8a..859d797 100644 --- a/www/www-header.php +++ b/www/www-header.php @@ -91,7 +91,7 @@ if (!isset($noSecurityCheck) || $noSecurityCheck !== true) { require __DIR__ . '/www-security.php'; } -function render($tplname, $vars = array()) +function render($tplname, $vars = array(), $return = false) { $vars['baseurl'] = '/'; if (!empty($GLOBALS['phorkie']['cfg']['baseurl'])) { @@ -117,8 +117,14 @@ function render($tplname, $vars = array()) $vars['suggestSetupCheck'] = $GLOBALS['phorkie']['suggestSetupCheck']; $template = $GLOBALS['twig']->loadTemplate($tplname . '.htm'); - echo $template->render($vars); + + if ($return) { + return $template->render($vars); + } else { + echo $template->render($vars); + } } + function redirect($target) { header('Location: ' . $target);