Introduction of Modules Architecture.




Introduction of Modules Architecture.

2012-04-25 07:49:53 Gönderen : Mr Developer Developer

When the application becomes bigger and bigger the controller, models and views/scripts directories contain more and more files. That’s a bit odd, because it becomes difficult to maintain, and than the modules come in hand. As our application is based on Zend App there are tons of articles in the web, but let me show you a simple directory layout and … sample code that sets up the framework. 

You can visit 
Zend Module Structure  for more details. Here is a short description to clear your understanding how our application modules are working.

Each module has its group “controllers, models e views” independent, ie, everything is organized into folders and Zend does the rest (story!).Now Within each module you must add a file Bootstrap.php for initialization of your module, But note that the header is a little different:


class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {



class Admin_Bootstrap extends Zend_Application_Module_Bootstrap {


Note that in front of the class name Bootstrap you should use the name of your module, in the above case I am adding the bootstrap module admin, then the name should be Admin_Bootstrap and this class should be to Extent Zend_Application_Module_Bootstrap, because so Zend knows that this is a bootstrap module!