如何在模块中使用thinkphp的多级控制器?

如何在模块中使用thinkphp的多级控制器?
已邀请:

dolphinphp

赞同来自: simone

以用户模块举个例子:
 
新建多级控制器
 
application\user\admin\test\Index.php
代码如下,请注意命名空间。
<?php
namespace app\user\admin\test;

use app\admin\controller\Admin;
use app\common\builder\ZBuilder;

/**
* 用户默认控制器
* @package app\user\admin\test
*/
class Index extends Admin
{
public function index()
{
return ZBuilder::make('table')->fetch();
}
}
然后在菜单节点管理中,添加对应的节点url为:
user/test.index/index

然后访问
http://网址/admin.php/user/test.index/index.html

dolphinphp

赞同来自:

不过多级控制器这块还未全面测试,如果在使用过程中有什么问题,欢迎反馈。

要回复问题请先登录注册