I'm using Zend Framework 1.10.7 and I'm looking for a way to use a per module bootstrap to set up specific module configuration.
I thought it was as simple as extending Zend_Appplication_Bootstrap_Bootstrap
and putting it at the root of the module directo开发者_如何学Cry, but it doesn't seem to be.
See
- Matthew Weier O'Phinney's Module Bootstraps in Zend Framework: Do's and Don'ts and
- Rob Allen's Bootstrapping modules in ZF 1.8 and up
Zend_Application_Module_Bootstrap is the class you want to extend. So say you had a module called 'Blog', you'd create a bootstrap class like this:
class Blog_Bootstrap extends Zend_Application_Module_Bootstrap
{
// module specific bootstrap methods here
}
and put it at application/modules/blog/Bootstrap.php.
Please notice that every bootstrap will be runned, even you you load a controller of a specific module.
I'm new to Zend Framework.currently I'm using " create modular application with zend" tutorial by Jeroen Keppens to add modularity to my application.But to load modular layouts I'm trying to follow Matthew Weier O'Phinney's Module Bootstraps in Zend Framework: Do's and Don'ts
精彩评论