template = file("./templates/".$name.".tpl"); $this->template = implode("",$this->template); $this->template = str_replace("\"", "\\\"", $this->template); return $this->template; } function printtemplate ($template) { echo $template; } function parse_if ($template) { $this->template = $template; $this->pattern = '!\!isU'; $this->template = preg_replace($this->pattern, "if ($1);", $this->template); $this->pattern = '!(.*?)<\/do>!isU'; $this->template = preg_replace($this->pattern, ":$1;", $this->template); $this->pattern = '!<\/if>!isU'; $this->template = preg_replace($this->pattern, "endif;", $result); } }