diff -r 5eaf3bd2cd90 -r 05ad3a6f58e5 server/php/basic/resources/library/templateFunctions.php --- a/server/php/basic/resources/library/templateFunctions.php Tue Sep 22 00:03:37 2015 +0200 +++ b/server/php/basic/resources/library/templateFunctions.php Tue Sep 22 00:04:14 2015 +0200 @@ -1,40 +1,41 @@ 0) { - foreach ($variables as $key => $value) { - if (strlen($key) > 0) { - ${$key} = $value; - } +function renderLayoutWithContentFile($contentFile, $variables = array(), $css = array()) +{ + $contentFileFullPath = TEMPLATES_PATH.'/'.$contentFile; + + // making sure passed in variables are in scope of the template + // each key in the $variables array will become a variable + if (count($variables) > 0) { + foreach ($variables as $key => $value) { + if (strlen($key) > 0) { + ${$key} = $value; } } - - require_once(TEMPLATES_PATH . "/header.php"); + } - echo "