简易调用及实例化控制器
创建函数文件function.php
function C($name,$method){
require_once('/libs/Controller/'.$name.'Controller.class.php');
//$testContreller = new testContreller();
//$testContreller->show();
eval('$obj = new'.$name.'Controller();$obj->'.$method.'();');}
/****
eval() 函数可将字符串转换为代码执行,并返回一个或多个值。eval()函数调用简单但是不安全
eval('$obj = new'.$name.'Contreller():$obj->'.$method.'():');
可替换为下面代码:
$controller = $name.'controller';
$obj = new $controller();
$obj ->$method();
*****/