Re: Re: OOP - Calling methods from classes that are inheriting?
| From: | Ben Stones | Date: | Sun, 21 Sep 2008 17:27:51 +0000 |
| Subject: | Re: Re: OOP - Calling methods from classes that are inheriting? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-280650@lists.php.net to get a copy of this message | ||
Hi, maybe if I post below what I'm trying to do it may make more sense:
class myClass {
public function func() {
$hello = "Yay!!";
}
}
class otherClass extends myClass {
public function otherFunc() {
echo parent::func();
}
}
$class=new otherClass();
echo $class->otherFunc();
Nothing outputs. Sorry I am slightly new to OOP so there may be a simple fix
for this?
2008/9/21 Lupus Michaelis <mickael+php@lupusmic.org<mickael%2Bphp@lupusmic.org>
>
> Ben Stones a écrit :
>
>> Hope I have made myself as clear as possible!
>>
>
> I did'nt understand what you mean, but I guess you're seeking for the
> parent keyword. Read again the PHP manual about OOP.
>
> --
> Mickaël Wolff aka Lupus Michaelis
> http://lupusmic.org
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>