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'])) {
$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);