Re: passing variables and functions between a base class and subclass
| From: | Justin Garrett | Date: | Thu, 06 Feb 2003 22:56:05 +0000 |
| Subject: | Re: passing variables and functions between a base class and subclass | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-134689@lists.php.net to get a copy of this message | ||
<?php
class base {
var $a;
function hello(){
echo "hello";
}
}
class sub extends base {
function hi(){
$this->a = "hi";
$this->hello();
}
}
$foo = new sub;
$foo->hi();
echo $foo->a;
?>
Justin Garrett
"Electroteque" <daniel@electroteque.org> wrote in message
news:20030206204614.70607.qmail@pb1.pair.com...
> hi there sorry about the long subject , but i have not mastered yet how to
> pass funtcions and variables between a base and subclass , i cant seem to
> access variables properly between the bass class and subclass and
functions
> from the subclass in the base class ?
>
>