smarty = new extSmarty($tpl_dir); $this->template = $template; } public function setView($view) { $this->view = $view; } public function execute() { if(is_array($this->view)) { foreach($this->view as $key => $value ) { $this->smarty->assign($key, $value); } } $this->smarty->display($this->template); } public function save($html_path){ if(is_array($this->view)) { foreach($this->view as $key => $value ) { $this->smarty->assign($key, $value); } } if(!file_exists(dirname($html_path))) mkdir(dirname($html_path), 0755, true); file_put_contents($html_path, $this->smarty->fetch($this->template)); } }