I am trying to create a web app (CMS) as part of my research project, and I use the code below to load modules into a page. Please review this code.
public function LoadModule($module,$position){
if(file_exists('modules/'.$module.'.tpl'))
{
//todo: might have to get a better thing for this !
$mod = 'modules/'.$module.'.tpl';
ob_start();
include($mod);
$mod = ob_get_clean();
$this->html = str_replace('__{'.$position.'}__', $mod ,$this->html);
}
else{
if(function_exists('LOGIT')){
LOGIT('$module - module not found.');
}
else {
$this->html = str_replace('__{'.$position.'}__', "$module Modlule not found" ,$this->html);
}
}
}