Re: Problems with class and included files
| From: | Brian Clark | Date: | Fri, 24 Nov 2000 21:30:28 +0000 |
| Subject: | Re: Problems with class and included files | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27049@lists.php.net to get a copy of this message | ||
Hello Eduardo,
(EJG == ""Eduardo Jordán G."") ejordan@interactive.net.ec writes:
EJG> Have this class in myclass.php:
EJG> class FOO{
EJG> function FOO()
EJG> {
EJG> }
EJG>
EJG> function myfoo()
EJG> {
EJG> print "<HTML>Html stuff $CONFIG[\"config1\"]";
EJG> print "more html stuff $CONFIG[\"confign\"]";
EJG> }
EJG> }
class FOO{
function FOO()
{
}
/* one way */
function myfoo($CONFIG)
{
print "<HTML>Html stuff $CONFIG[\"config1\"]";
print "more html stuff $CONFIG[\"confign\"]";
}
}
EJG> All definitions of array $CONFIG are kept in myconf.php
EJG> When I want to use clas FOO in a php file, I go:
EJG>
EJG> include "myconf.php";
EJG> include "myclass.php"
EJG>
EJG> $objFoo = new FOO();
EJG> $objFoo->myfoo();
/* one way */
$obj->myfoo($CONFIG);
http://www.php.net/manual/html/functions.html
http://www.php.net/manual/html/language.references.html
http://www.php.net/manual/html/language.variables.scope.html
EJG> The problems is that array $CONFIG doesn't show any values.
EJG> Please send e-mail directly I use digest list.
EJG>
EJG> Thank you,
Any particular reason you sent this to the list five times?
-Brian
--
Most people find the concept of programming obvious,
but the doing impossible.