Yaf 中Module,Controller,Action的区别

模块Module
控制器Controller
方法Action

Yaf的默认Module是Index,浏览器访问http://127.0.0.1/index.php/Index/index,其实就是请求了Index模块下的Index控制器下的indexAction方法。

在目录application\下新建目录modules。除了默认模块,其他模块都放在application\modules\下。

创建目录application\modules\Mobile。
修改配置

; 多个模块,使用逗号分隔
application.modules = "Index,Mobile"

然后在Mobile下面创建controllers,就可以使用了。
这个时候http://127.0.0.1/index.php/Mobile/Index/index,就会访问到对应的模块下的内容。

posted @ 2020-01-06 13:44  TBHacker  阅读(753)  评论(0编辑  收藏  举报