<?php
class tpl{
function get($tpl){
$tplPath = 'пътя/до/тпл/'.$tpl.".tpl";
$f = @fopen($tplPath, 'r');
$r = @fread($f, filesize($tplPath));
fclose($f);
return $r;
}
function parse($tplCont, $arr){
foreach($arr as $a => $b){
$tplCont = str_replace("{".$a."}", $b, $tplCont);
}
print $tplCont;
}
} //end of class
?>