简易调用及实例化模型
function M($name){
require_once('/libs/Model/'.$name.'Model.class.php');
//$testModel = new testModel();
eval('$obj = new '.$name.'Model();');
return $obj;
}
eval()函数调用简单但是不安全
eval("$obj = new".$name."Model();");
可用下面代码代替:
$model = $name."Model";
$obj = new $Model();