|
From: Odysseas T. <ody...@ya...> - 2001-07-08 15:59:21
|
The load_order defines the order of module
instantiation (mnemonic: instantiation == loading) not
the order of display.
The order of display is the same as the order of
appearence in the index.php.
So after you run _IncludeModules
the
$Page->modules['content']
order should be (as you noticed) the same as the order
of appearence.
The default layout will simply iterate over that
array outputing the cached output of each module
and that will produce the desired result.
In order to see the actual order of modules
instantiation just stick a debugging stmt in the for
loop (function _IncludeModules), right after the
instantiation:
foreach ($modules[$_group]['load'] as
$pos=>$mod) {
import("user.mod.$mod[package].$mod[name]");
$this->modules[$_group][$pos] = new
$mod['name']($mod['options']);
echo("group: $_group, module
$mod[name]\n");
}
You will see your debugging output right above the
binarycloud image.
odysseas
--- Justin Farnsworth <je...@ey...> wrote:
> Odysseas:
>
> Nope, nada, niente, pas de tout, is
> load_order having _ANY_ effect on the
> disto index.php.
>
> If I comment the layout template in index.php, thus:
>
> 'modules' => array(
> 'content' => array(
> # 'layout' => array(
> # 'name' => "example",
> # 'package' =>
> "html.layouts",
> # ),
>
> then the load order still follows the order of the
> module appearance in index.php, instead of
> the appearance to load_order of
>
> 1st 3
> 2nd 6
> 3rd 1
> 4th 5
> 5th 4
> 6th 2
>
> I never have understood this...
>
> If I put:
>
> echo "<pre>";
> var_dump($Page->modules['content']);
> echo "</pre>";
>
> in the HelloWorld.php module, I get
>
>
> array(6) {
> [0]=>
> object(otherworld)(1) {
> ["stuff"]=>
> string(25) "This is some sample stuff"
> }
> [1]=>
> object(set_lang_example)(0) {
> }
> [2]=>
> object(helloworld)(2) {
> ["options"]=>
> array(2) {
> ["example"]=>
> string(23) "this is an option value"
> ["another"]=>
> int(1)
> }
> ["date"]=>
> string(12) "Jul:Sun:2001"
> }
> [3]=>
> object(helloworld)(2) {
> ["options"]=>
> NULL
> ["date"]=>
> string(12) "Jul:Sun:2001"
> }
> [4]=>
> object(helloworld)(2) {
> ["options"]=>
> NULL
> ["date"]=>
> string(12) "Jul:Sun:2001"
> }
> [5]=>
> object(helloworld)(2) {
> ["options"]=>
> NULL
> ["date"]=>
> string(12) "Jul:Sun:2001"
> }
>
> which means it is not sorting, but following
> appearance order.
> I even added your ksort fix in Page.php where you
> said it
> should go, and it still just follows appearance
> order.
>
>
> _jef
>
>
> ------------------------
> Odysseas Tsatalos wrote:
> >
> > But you were right that the rest of the code
> > isn't behaving the way it was supposed to :-)
> >
> > I needed to add a ksort right before the end of
> the
> > IncludeModules function
> >
> > ksort($this->modules[$_group]);
> >
> > Keep in mind that the the "example" layout that
> > index.php comes with is not following the
> > default order but it explicitly alters it.
>
> --
> Justin Farnsworth
> Eye Integrated Communications
> 321 South Evans - Suite 203
> Greenville, NC 27858 | Tel: (252) 353-0722
>
> _______________________________________________
> binarycloud-dev mailing list
> bin...@li...
>
http://lists.sourceforge.net/lists/listinfo/binarycloud-dev
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/
|