__construct($config); } //设定变量 function assign($var,$val) { $this->set_var($var,$val); } //兼容Smarty的写法,不推荐 function display($file) { $array = $this->_format_file($file); $htmlfile = $array["htmlfile"]; $folder = $array["folder"]; $this->p($htmlfile,$folder); } function plugin($identifier,$filename,$isfetch=false) { if(!defined("APP_NAME")) { return false; } if(APP_NAME == "admin") { $file = "../../../plugins/".$identifier."/".$filename; } else { $file = "../../plugins/".$identifier."/".$filename; } if($isfetch) { return $this->fetch($file); } else { $this->display($file); } } //获取返回的数据 function fetch($file) { ob_start(); $array = $this->_format_file($file); $htmlfile = $array["htmlfile"]; $folder = $array["folder"]; $this->p($htmlfile,$folder); $msg = ob_get_contents(); ob_end_clean(); return $msg; } function _format_file($file) { $end_file = basename($file); $htmlfile = substr($end_file,0,-(strlen($this->ext)+1)); $folder = substr($file,0,-(strlen($end_file))); return array("folder"=>$folder,"htmlfile"=>$htmlfile); } } ?>