2010年12月3日星期五

Re: [fw-mvc] Re: Where are the module bootstraps objets saved?

-- Marko78 <marko.korhonen@gmail.com> wrote
(on Friday, 03 December 2010, 10:13 AM -0800):
> I did not mean resources like view, cachemanager etc.
>
> I mean the module bootstrap classes. I have modules in my application
> which all have extended from Zend_Application_Module_Bootstrap.

Ah -- you didn't specify that in your original message.

You *can* get at them, just not easily, via the "modules" resource. Its
"getExecutedBootstraps()" method returns an ArrayObject, where the keys
are the module names and the values are the bootstrap objects for the
modules.

$modules = $bootstrap->getResource('modules');
$bootstraps = $modules->getExecutedBootstraps();
$blogBootstrap = $bootstraps['blog'];


> I would like to have module hook methods in these module bootstrap
> classes as they are already loaded. Then I could loop through these
> classes if some code wants to invoke some method, e.g. I have content
> form, then tag module can alter this form by adding input field for
> tags. If I remove or deactivate tag module, content form won't have
> tags field anymore. Same goes for handling the post data when saving
> content.
>
> Does this sound weird?
>
> br, Marko
>
> -----
> br,
> --------------------------
> Marko Korhonen
> Technical Consultant
> --
> View this message in context: http://zend-framework-community.634137.n4.nabble.com/Where-are-the-module-bootstraps-objets-saved-tp3070011p3071516.html
> Sent from the Zend MVC mailing list archive at Nabble.com.
>

--
Matthew Weier O'Phinney
Project Lead | matthew@zend.com
Zend Framework | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

没有评论: