-
July 19th, 2005, 06:18 PM
#1
Calling a method of an object of a child.
I have two classes, Abba and Baka.
Baka extends Abba. Abba contains a list of arrays (empty on instantiation).
Baka has a method which adds to these arrays. Each array added has:
String: Identifier (just a name)
Object: Reference
String: Name of Function in the above object.
I'd like to be able to call that object's function from Abba by doing something like the following:
PHP Code:
//Assume $caldera is one of those
//arrays I mentioned.
//$args is an array of arguments.
call_user_func_array(array(&$this->$caldera[1], $caldera[2]), $args);
Since $caldera is an object contained in the child, I should be able to reference it by &$this-> ... but I get the following error:
Warning: call_user_func_array(): First argumented is expected to be a valid callback, 'Array' was given in C:\sambar62\docs\Foo\Foo.php on line 145
Any ideas?
-
July 24th, 2005, 04:09 AM
#2
post the whole code, it'll help with debugging.
thanks,
PuReWebDev
-
July 24th, 2005, 10:53 PM
#3
Got it working, thanks. You can see the demo at http://mygripe.net/ao_guys.php . Only works in Firefox at the moment.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|