rendered paste body <?php
class parseTemplateFile {
var $output;
function parseTemplateFile($templateFile){
$this->output=file_get_contents($templateFile);
}
function assign($key, $val)
{
global $ar1, $tempVARS;
$ar1 = array("$key" => "$val");
$tempVARS = array_merge($ar1, $tempVARS);
}
function parseTemplate($tempVARS=array()){
foreach($tempVARS as $tag=>$data){
$data=$this->output=str_replace('{$'.$tag.'}',$data,$this->output);
}
}
function display(){
$this->output=preg_replace('/{\$(.+)}/','', $this->output);
return $this->output;
unset($this->output);
}
}
?>