zend bootstrap: for each module
Is it good or ba开发者_高级运维d practice to create separate bootstrap for each module. They make the project look a lot less disorganized in my opinion so I'd like to know if it's the norm to have them in each module.
For ZF1, there currently is no official recommendation to my knowledge. Your best bet is
- Matthew Weier O'Phinney - Module Bootstraps in Zend Framework: Do's and Don'ts
I don't think there's any "best practise", like much in ZF it's just another choice available to you.
Personally, I rarely use them. Module bootstraps are a nice idea, but since by default all module bootstraps run on every request I don't really see the point.
There are some examples of how to make module bootstraps only run when the current request is for that module, Matthew's article has some good links.
精彩评论