[UPHPU] Sharing included data
Jon Jensen
jon at jenseng.com
Wed Sep 6 12:32:36 MDT 2006
> However, as you can see, I have found it necessary to pass
> the object variable back into the object in order for the
> HEADER.INC.PHP file to be able to use the object and the data
> in it. This makes for a messy function call like this:
>
> $init->auth->userStatus
You probably want to use "$this" instead. Since the include file is being
inserted right in the middle of that class function, the code is executed as
if it were right there in the function. Any local or member variables will
be available to it. So you can do things like this in your include file:
var $foo = $this->auth->userStatus;
var $bar = $this->someFunction();
Jon
More information about the UPHPU
mailing list