强哥或路过的大侠帮帮忙!怎么在路径中隐藏模块中的default

本地:http://localhost/54/ book/default/index.html

http://localhost/54/ 是应用的根目录

book是模块,default是默认的Controller,index是动作

因为模块基本上都用DefaultController做默认的Controller,default也没什么实际的意义

我现在想在访问的时候把这个default隐藏掉

[color="#FF0000"]就是路径变成http://localhost/54/book/index.html[/color],不知道有没有什么好办法

我试过在config/main.php里 配置controllerMap

可是出一堆问题

我现在是想http://localhost/54/book/index.html 可以访问到 r=book/default/index

并且http://localhost/54/book/admin/index.html 访问r=book/admin/index 还不会受影响

谁有好办法~~ 帮帮忙啦~ 感谢

自己顶上去

手册里路由的那一节看看,里面的规则。

好像是


'<action>'=>'default/<action>'

感谢,我去瞧瞧,我在手册里没找到路由章节,能否给个link

不知道这样写会不会有副作用

毕竟隐藏 default 会让如有有误会

/book/index BookController actionIndex

/book/index BookModule DefaultController actionIndex

route 会分的清吗 应该避免出现 同名的模块和 顶级Controller吧

具体请查看手册

http://www.yiiframework.com/doc/guide/1.1/en/topics.url