Active module based config with Zend Framework

BinaryKitten has posted an article on how do module specific bootstrapping within a module’s bootstrap class:

The Concept I wanted to achieve was to have unique Configuration based upon the module that was active. The Issue with this is that the Bootstrap files and the _init functions for ALL modules are called with no bias as to which module is active. Thus if you created a 3 modules wanted to make menu alterations in one, those alterations will be applied to all. I also wanted to have a a system where if i added extra modules i could just add extra functions to the bootstrap file and it would work in a similar way.

She then goes on to post a solution using a front controller plugin that calls back into the currently active module’s bootstrap to execute methods that start with _activeInit.

Go have a read! It’s a nice, extensible solution to the problem

Posted by Rob on 5th January 2010 under Around the web | 1 Comment »

One Response to “Active module based config with Zend Framework”

  1. BinaryKitten responded on 11 Jan 2010 at 3:30 pm #

    Have now made an update to the above mentioned Posting

    • Updated to fix the typos
    • Added in a quick check to see if the module exists in the modules list of bootstraps
    • Removed the _ from the function name that it searches for, this should please the people who are adament over the Zend Coding Standards
    • Added in the functionality to have $modulenameInit() functions as well in both active module bootstrap and the application bootstrap