2009年6月22日星期一

[fw-mvc] Application resources & order

Hi,

Quick question regarding the order application resources are
initialized.

Suppose I have in my config file:

resources.myresource.option1 = blah
resources.myresource.option2 = blah
resources.myresource.option3 = blah

This will execute (initialize) my Amz_Application_Resource_Myresource.

I could also use the init in the bootstrap like this:

protected function _initMyresource()
{
$options = $this->getOptions();
// do stuff
}

Now, if I add this line to the init, I can force that another resource
is loaded/bootstrapped before myresource:

$this->bootstrap("anotherresource");

How can I enforce this with application resource classes that depend
on something else? a) another resource class or even b) one
initialized by the _init* bootstrap functions.

I hope this question makes sense, I'm a bit groggy of studying for my
ZFC tomorrow. Think I'm ODing on ZF. ;-)

Jeroen Keppens
http://blog.keppens.biz

没有评论: