2009年3月26日星期四

Re: [fw-mvc] Registered Modules

That's great.
This is the way I'm currently using.
What I meant is that we can't explicity tell the framework which module depends on which module because we don't have a "formal" modules registry.

Best regards,

--
Ramses Paiva
Software Architect
Sourcebits Technologies
www.sourcebits.com


On Fri, Mar 27, 2009 at 10:55 AM, Petre Balau <petre.balau@yahoo.com> wrote:
Hello,

In my bootstrap, I have something like:

$frontController->setControllerDirectory(
    array(
        "default"       => "app/modules/default/controllers",
        "users"         => "app/modules/users/controllers",
        "admin"         => "app/modules/admin/controllers",
        // boxes
        "components"    => "app/modules/components/controllers",
        // main
        "galleries"     => "app/modules/galleries/controllers",
        "quotes"        => "app/modules/quotes/controllers",
    )
);


"default", "users", "admin" etc are modules.

Then, you can use something like:
$fc = Zend_Controller_Front::getInstance();
$directories = $fc->getControllerDirectory();

to get the modules (the keys from $directories are the modules).

Regards,
Peter


From: Ramses Paiva <ramses@sourcebits.com>
To: fw-mvc@lists.zend.com
Sent: Friday, March 27, 2009 6:51:46 AM
Subject: [fw-mvc] Registered Modules

Hello list,


Something I'm really missing right now is a way to check my registered modules within the front controller.
I have a modular application and it would quite handy for checking dependencies if I had it on the framework.
Any hint?


Best regards,

--
Ramses Paiva
Software Architect
Sourcebits Technologies
www.sourcebits.com

没有评论: