I have an class with some instance variables. It’s purpose is for templating.
So this class has a fetchTemplate() method which includes a PHP template file.
In my template file, I can access any variable that has been assigned to the template, by writing:
echo $this->theVariable
If there was a way to “pull” all arbitrary instance variables into the local variables scope of fetchTemplate(), it would be possible to simply write:
echo $theVariable
I slightly remember that there was something….
You can cast the object to an array and use
extract():but I think it will just work on
publicvariables.