template = file_get_contents($template); if($fill) $this->fillTags(); } /* function __set($tag, $content) { $this->params[''] = $content; } */ function __get($tag) { return $this->params['']; } function output($buffer) { $this->assign('buffer', $buffer); return str_replace(array_keys($this->params), array_values($this->params), $this->template); } function assign($id, $value = null) { if(is_array($id)) foreach($id as $tag => $content) $this->params[''] = $content; else $this->params[''] = $value; } private function fillTags() { preg_match_all('//', $this->template, $a); foreach($a[0] as $tag) $this->params[$tag] = null; } }