ZF2 module best practices

老子叫甜甜 提交于 2019-12-11 03:05:22

问题


What is the accepted best practice with the Zend Framework's new module system in version 2? Is it the intention that I create one module per controller for my application, or am I supposed to use the modules to group related controllers and their models together in some way?


回答1:


See Rob Allens introduction into Modules or Matthews introduction into Modules.

In Short: A module is simply a bunch of Classes that perform one specific task. I.E.: A Guestbook could be one Module. GuestbookMailing could be another module (but doesn't need to be). You can have multiple Controllers, Models, Views in your Module. But it should be all tied to one part of your whole application.



来源:https://stackoverflow.com/questions/14582579/zf2-module-best-practices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!