Why have zf2 Application folder inside Modules/ and Modules/Application/src? I mean... why not the structure Modules/Application/src/controller, etc..?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
You can find details of the new zf2 structure http://akrabat.com/zend-framework-2/modules-in-zf2/
Modules are intended to be single-purpose, reusable containers of code. As such, they will contain everything they need to accomplish that task -- which may (or may not!) include controllers, models, public assets, configuration, view templates, and more.
In order to keep the various pieces semantically grouped, each has its own subfolder in the module. Source PHP code goes in "src", and the code in that directory should follow PSR-0 naming conventions - and thus you'll see the module namespace repeated there. Configuration goes in "config", view templates in "view", public assets in "public", and so on.
That said, you're free to organize your modules however you want, so long as its Module class is discoverable, and it can indicate how to autoload classes and provide configuration to the MVC. The structure you see in the ZendSkeletonApplication and ZendSkeletonModule, however, is recommended as it's the result of a lot of brainstorming within the community, and provides clean semantics for each type of file provided.