<?PHP//Call Function C of the controller functionC$name,$method){ require_once('/libs/controller/'.$name.‘ Controller.class.php '); //eval (' $obj = new '. $name. ' Controller (), $obj-$method. ' (); '); $controller=$name.‘ Controller '; $obj=New $controller(); $obj-$method.(); } //Call function M for the model functionM$name){ require_once('/libs/model/'.$name.‘ Model.class.php '); //eval (' $obj = new '. $name. ' Model (); '); $model=$name.‘ Model '; $obj=New $model(); return $obj; } //Call function for view v functionV$name){ require_once('/libs/view/'.$name.‘ View.class.php '); //eval (' $obj = new '. $name. ' View (); '); $view=$name.‘ View '; $obj=New $view(); return $obj; } functionORG ($path,$name,$params=Array()){//Path is the name of the third-party class named params is the class that needs to be specified, assigned a property when initialized, in the format array (property name = = Property value, property name 2=> property value 2 ...) require_once(' libs/org/'.$path.$name.‘. Class.php '); //eval (' $obj = new '. $name. ' (); '); $obj=New $name(); if(!Empty($params)){ foreach($params as $key=$value){ //eval (' $obj '. $key. ' = '. $value. ' \ '; '); $obj-$key=$value; } } return $obj; } //data used to filter illegal parameters//GET_MAGIC_QUOTES_GPC function to determine whether to invoke the Magic method//addslashes function Escape string functionDaddslashes ($str){ return(!GET_MAGIC_QUOTES_GPC())?addslashes($str):$str; }?>
MVC Call Function function.php