Hi,
I have basic setup made with Zend_Application + module bootstrapping.
I want to enforce modular approach so that every module is more responsible
of bootstrapping themselves.
For example, I have made _invokeHook method in my bootstrap, which loops
through
modules and check for certain hook (class) and method. If one is found, it
gets called
with some arguments.
Example of constructing Zend_Navigation by module hook:
1. Zend_Navigation is made in Bootstrap class by initial setup which defines
root level of my navigation.
2. Then hook is called with Zend_Navigation object as argument:
_invokeHook("navigation", "setNavigation", array($navigation))
3. If module has Navigation.php and Modulename_Navigation class and
setNavigation method,
hook is called.
4. setNavigation method makes it's own additions to Zend_Navigation object =
sets the navigation pages which are found from the module.
I was wondering if someone else have made such "Hook" implementations and if
there's some serious no-go's for this kind of approach.
By my initial test with Zend_Navigation, it seems that it could help me
build more modular application where my modules are defining how my
application is working.
br, Marko
--
View this message in context:
http://n4.nabble.com/Bootstrap-hooks-tp932808p932808.html
Sent from the Zend Framework mailing list archive at Nabble.com.