Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I try to keep my library folder for cross-project stuff, a kind of vendor folder for libs that I drop in and either use directly or extend in my own classes (adding autoloadernamespaces entries, as required).</p> <p>In a multi-module application, I keep cross-module stuff - like a common models, mappers, view helpers, and partial scripts that will be used by all modules - at application-level, named with the appnamespace (<code>Application_</code> or <code>My_</code> or some such thing). Then, I push all modules - including the default module! - into <code>modules</code> folder. Module-specific stuff - like controllers, forms, views - are then namespaced with the module name. Something like:</p> <pre><code>/application /configs application.ini /layouts /models # app-level! /modules /admin /controllers /forms /models /views /helpers /scripts /front /controllers /forms /models /views /helpers /scripts /views # app-level! /helpers /scripts /data /cache /library /App /Zend /public index.php /assets /css /img /js /scripts </code></pre> <p>Typically, the module bootstrap classes - extending <code>Zend_Application_Module_Boostrap</code> - registers the correct resource autoloader mappings to make object instantiation a breeze. </p> <p>One note: Since I prefer that my controllers employ the module namespace in which they reside, I need to set a param on the frontcontroller to make him aware of that:</p> <pre><code>resources.frontController.params.prefixDefaultModule = true </code></pre> <p>tl:dr: </p> <ul> <li>Cross-project classes reside in <code>library</code> and employ their own lib namespace.</li> <li>App-level, cross-module classes reside at app-level and employ the appnamespace</li> <li>Module-level classes reside in a module folder and employ the module namespace</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload