Yaf 中Module,Controller,Action的区别

模块Module
控制器Controller
方法Action

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

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

创建目录applicationmodulesMobile。
修改配置

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

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

原文地址:https://www.cnblogs.com/jiqing9006/p/12155908.html