Class question
| From: | Alex | Date: | Sat, 29 Nov 2003 19:47:41 +0000 |
| Subject: | Class question | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-22243@lists.php.net to get a copy of this message | ||
Hello ALL!
I tried to make a class in another class something like:
<?php
class A{
function a(){
echo "Hello from class A a subclass of ".$this->parent->var1;
}
}
class B{
function b(){
$this->var1="Class B";
$this->var2=new A();
}
}
$c=new b();
?>
In this script I use class A inside class B and I want to use
variable from B inside A.
I wanted: Hello from class A a subclass of Class B
But the result is: Hello from class A a subclass of
Is it possible something like: $this->parent->var1 or similar?
--
Best regards,
Alex