note 36696 added to keyword.extends
| From: | robertvanderlinden78 at hotmail dot com | Date: | Sun, 19 Oct 2003 03:50:30 +0000 |
| Subject: | note 36696 added to keyword.extends | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-58866@lists.php.net to get a copy of this message | ||
the model as in the example of "quinton" is what you want to have. Not the method of
"kimh216" with function callClass
when calling
function C()
{
//global $a,$b;
$this->a = parent::callClass('A');//no effect
$this->b = parent::callClass('B');//no effect
}
you will not have 1 data object.If i wanted to add a function to class A and i wanted to call it , I
can only do it from Class C .. otherwise if I were to do
$c = new C();
$c->someExtraFunctionThatIsInClassA(); it will give an error stating "Fatal error: Call to
undefined function: functionName() in f:\ibserver\www\meuk\classvbs\test.php.php on line 34"
------------
If i add a new function in Person class of the first example of quinton:
function boe(){
echo "some text";
}
then i can call it by :
$family->members[0]->boe();
since the members array has Personobjects in it. Now you have 1 Object that can access every
function as a whole.
regards rml
----
Manual Page -- http://www.php.net/manual/en/keyword.extends.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+36696
Delete -- http://master.php.net/manage/user-notes.php?action=delete+36696&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+36696&report=yes
Search -- http://master.php.net/manage/user-notes.php