From: "Alex Hogan" <[EMAIL PROTECTED]>

> What are the rules of thumb for classes and included files?
>
> Can I not include a file in a class function?  If I put the include()
> outside the class structure everything works fine, but when I put it
inside
> the class it freaks.
>
> Am I doing something wrong?
>
> Class myclass{
>             Include('myfile'); -- doesn't work
>             Funciton myfunc($var1, $var2){
>                         Include('myfile'); -- doesn't work
>             }
> }

It depends what's in the include file. You can do that, but the end result
has to be a valid class. Using an include is basically like cutting and
pasting the file at the point you have include(). So, if you're doing it
this way, "myfile" must be variable declarations or methods, since you're
already inside the class.

---John Holmes...

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

Reply via email to