|
From: Justin F. <je...@ey...> - 2001-07-08 05:18:20
|
Alex:
Sometimes my mind just falls apart, and I feel like I am in that
state right now. In one of your last posts, you suggested to
get a large/complex bit of data and store it in a class variable,
and then (implied) down the load chain, this variable can
be accessed.
HOW?
Especially, what if I want something from a module in a group
when they are two instances, but do different things because
of passed in options.
EXAMPLE stanza / module group top
'modules' => array(
'top' => array(
'load' => array(
array(
'name' => "EyeLibrary",
'package' => "lib",
'load_order' => "1",
'options' => "option1",
),
array(
'name' => "EyeLibrary",
'package' => "lib",
'load_order' => "2",
'options' => "option2",
),
array(
'name' => "Blank",
'package' => "lib",
'load_order' => "3"
),
),
),
----------
Now in the above stanza, EyeLibrary that has load order "1"
does something as dictated
by option1, and stores that data at, say, $this->what_i_need.
EyeLibrary that has load order "2" does something as dictated
by option2, and stores that data at, say, $this->what_i_need.
NOW, how the hell do I get the data EyeLibrary[0]->what_i_need?
NOW, how the hell do I get the data EyeLibrary[1]->what_i_need?
Both of these pieces of data are desired in Blank, load order
"3".
If I instantiate a new EyeLibrary within a following module,
this is no good at all, because I have in the constructor
something like:
function EyeLibrary($_options="ain't no options in EyeLibrary")
{
$this->options = $_options;
some other code, maybe
return true;
}
so all I would get was "ain't no options...", which, for the example,
is EyeLibrary->what_i_need.
How do I do this without going global????
You instantiate the thing in $Page->_IncludeModules() with the
options from $bc_page, but how do I get to that instantiation, and
distinguish
between the two loads???? WITHOUT GOING GLOBAL SCOPE
in the constructor???
My mind is mush right now...
_jef
--
Justin Farnsworth
Eye Integrated Communications
321 South Evans - Suite 203
Greenville, NC 27858 | Tel: (252) 353-0722
|