assign[$name] = $value; } /** * 显示视图 * @param $file */ // public function display($file) // { // $file = APP.'/views/'.$file; // if (is_file($file)){ // extract($this->assign);#从数组中将变量导入到当前的符号表 // include $file; // } // } public function fetch($file = ""){ // var_dump($this->assign); // exit; if (!empty($this->assign)) { extract($this->assign); } if ($file) { $filename = ROOT_PATH ."html" . DS . $file; } else { $filename = ROOT_PATH ."html" . DS . $GLOBALS['action'] . '.html'; } return require($filename); } }