在控制器内直接使用 new 关键字实例化其他控制器类即可完成对其他控制器的调用
在 index 控制器内调用 test 控制器并执行其 runme 方法 :
<?php class testController extends grace{ public function runme(){ echo 'run...'; } }
class indexController extends grace{ public function index(){ //系统会自动调用视图 index_index.php $testController = new testController(); // 设置 gets 数据 $testController->gets = array(1,2,3,'test...'); $testController->runme(); } }