preparations for rewrite

This commit is contained in:
2025-01-11 23:14:09 +01:00
parent 637a781f24
commit cf07363a8d
39 changed files with 105 additions and 66 deletions

16
src/helpers.php Normal file
View File

@@ -0,0 +1,16 @@
<?php
function renderTemplate($templatename,$variables=[],$basepath=ROOT.'/src')
{
ob_start();
if(is_array($variables))
extract($variables);
if(file_exists($basepath.DS.'templates'.DS.$templatename.'.php'))
include($basepath.DS.'templates'.DS.$templatename.'.php');
else if(file_exists($basepath.DS.'templates'.DS.$templatename))
include($basepath.DS.'templates'.DS.$templatename);
$rendered = ob_get_contents();
ob_end_clean();
return $rendered;
}