Re: Anyone on the list using Moodle?
| From: | Jasper Bryant-Greene | Date: | Wed, 17 Aug 2005 08:57:38 +0000 |
| Subject: | Re: Anyone on the list using Moodle? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-220736@lists.php.net to get a copy of this message | ||
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