萌新求幫忙看看
$m=new $module();
$m->$action();
$module=isset($_GET['m'])?$_GET['m']:'Index';
$action=isset($_GET['a'])?$_GET['a']:'Index';
class ?index{
function _constrcut(){
echo'調(diào)用了index控制器<br/>';
}
function ?index(){
echo'我是index的控制器的index方法';
}
}
exit;
define ('APP_NAME','APP');
define ('APP_PATH','./APP/');
require('./ThinkPHP/ThinkPHP.php');
報(bào)錯(cuò)如下:
Notice: Undefined variable: module in?D:\phpStudy\PHPTutorial\WWW\index.php?on line?13
Fatal error: Class name must be a valid object or a string in?D:\phpStudy\PHPTutorial\WWW\index.php?on line?13
2019-02-02
$m=new $module();
$m->$action();
$module=isset($_GET['m'])?$_GET['m']:'Index';
$action=isset($_GET['a'])?$_GET['a']:'Index';
變量還沒(méi)聲明,你就先實(shí)例化了