跨模块访问
在开发过程中经常会在当前模块调用其他模块的方法,这个时候就涉及到跨模块调用。
例如,我们在index模块调用test模块的操作方法:
class indexController extends base_controller {
public function test(){
$test = new testController();//在调用的时候类名必须为 Controller 开头字母大写
$test->index();
}
}
class testController extends base_controller {
public function index(){
echo '我是testController模块';
}
}