All pastes #420366 Raw Edit

Someone

public php v1 · immutable
·published 2007-04-02 02:26 UTC
rendered paste body
<?phpclass Template {    var $variables;    var $tempname;    var $template;        function Template($tempname) {        $this->tempname = $tempname;        $this->variables = array();    }        function addvar($varname, $varvalue) {        $this->variables[$varname] = $varvalue;    }        function display($tempname) {        $file = "./template/".$this->tempname."/".$tempname;        if (file_exists($file)) {            $this->template = file_get_contents($file);            $varray = array_keys($this->variables);            foreach ($this->variables as $find => $rep) {                $this->template = str_ireplace("{".$find."}", $rep, $this->template);            }            echo $this->template;        } else {            echo "The template that was requested could not be found, please contact the system administrator.";        }    }}?>