1、运用完全限定命名空间直接调用
public function call() { $obj = new \app\index\controller\Index; $obj->index(); }2、使用use
use \app\index\controller\Index as Admin; public function callUse() { $obj = new Admin(); $obj->index(); }3、使用ThinkPHP controller()函数
public function callCon() { $obj = controller("index/Index"); $obj->index(); }转载自:https://blog.csdn.net/success_a/article/details/106836356
部分素材资源来源网站,本站提供免费下载,如有侵权请联系站长马上删除!