时间:2021-07-01 10:21:17 帮助过:16人阅读
switch($action){ case "add1": $smarty=new Smarty(); $smarty->display("tianjiabumen.tpl"); break; case "del": $id=$_GET['id']; $bm=new bumenmodel(); $bm->id=$id; $bm->delete(); header("location:bumenkongzhiqi.php?action=chaxun"); break;
class factory(){ function __contruct(){ $this->models = array(); } function & getModel($modelName) { if(!isset($this->models[$modelName])){ require("{MODEL_BASEPATH}/{$modelName}"); $this->models[$modelName] = new $modelName(); } return $this->model[$modelName]; } }