Hey guys
how do i customise this class so that the Creatpage() function or the page that is send to the browser is processed as a php page instead of a html page . my html template(template.inc) has php include codes in the tables so it has to be processed as .php ?????
template.inc or template.php.inc?????
<?php
class HtmlTemplate{
var $template;
var $html;
var $parameters= array();
function HtmlTemplate ($template) { //sets which template to be used
$this->template = $template;
$this->html = implode("",(file($this->template))); //read the template into an array and then creat
}
function SetParameter ($variable,$value){ //sets tha particular values
$this->parameters[$variable] = $value;
}
function CreatePage (){ //does the bulk of the work
foreach ($this->parameters as $key => $value){ //loop thro all the parameters and set the variables to values.
$template_name='{'.$key.'}';
$this->html =str_replace($template_name,$value,$this->html);
}
echo $this->html;
echo "sawa";
}
}
?>