Re: Anyone on the list using Moodle?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



wayne wrote:
Okay, I got a reply from a moodle user pointing
me to an archive, apparently someone had the same
question. The answer seems to be that $CFG is
an array dressed up as an object.The books that
I'm learning from don't show this concept. Could
some kind soul give an example.
Thanks.

http://php.net/manual/en/language.types.object.php

When you use the uninitialised $CFG as an object, an object of class stdClass is created. You can then assign and read stuff to and from its properties, basically like you said, as an "array dressed up as an object".

There's no real reason for doing this although it may be a hack because some of the required files in that script may expect a $CFG object to exist.

Jasper

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux