2010年12月3日星期五

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

I always wondered this.
I ended up extending Zend_Application and making My_Application a singleton, then whenever I need a resource,
$app = My_Application::getInstance();
if($app->hasPluginResource('foo')) {
$foo = $app->getPluginResource('foo');
$foo->getSomething();
}
I don't know if that's evil/bad practice though... It probably is!

On 2 Dec 2010, at 19:38, Marko78 wrote:

>
> So I can get them and use their methods from anywhere?
>
> 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-tp3070011p3070011.html
> Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: