请求TP5的路由问题

浏览:4550 发布日期:2017/03/31 分类:ThinkPHP5专区 关键字: tp5 路由 路由配置
http://localhost/public/index.php/index/index/
上面的这地址是TP5默认的访问地址,访问的是Controller/index.php里面的index方法

http://localhost/public/user/index/
目前我想达成这种需求,user是Controller/user.php,index是user.php的方法,index.php已经按照手册隐藏起来了,但是这个地址的路由应该怎么配呢,包括user/follow、user/test等等,或其他act/index、act/follow、act/test等等

目前的route.php配置参数如下'testurl'   =>  'User/testurl',
'followers' =>  'User/followers',
'userIndex' =>  'User/index',
感觉如果每个都去route.php里这样写,有些费力,目的只是想去掉项目(index)的那层目录,有无好方法呢?
最佳答案
评论( 相关
后面还有条评论,点击查看>>