1、运用完全限定命名空间直接调用
public function diaoyong(){
$obj=new \app\index\controller\Index;
$obj->index();
}
2、使用use
use \app\index\controller\Index as Admin;
public function diaoyong2(){
$obj= new Admin();
$obj->index();
}
3、使用ThinkPHP controller()函数
public function diaoyong3(){
$obj=controller("index/Index");
$obj->index();
}