模块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,就会访问到对应的模块下的内容。

相关文章:

  • 2021-08-14
  • 2021-09-26
  • 2021-09-08
  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
  • 2021-03-30
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案