July 19th, 2005, 06:18 PM
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)
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:
Since $caldera is an object contained in the child, I should be able to reference it by &$this-> ... but I get the following error:
//Assume $caldera is one of those
//arrays I mentioned.
//$args is an array of arguments.
call_user_func_array(array(&$this->$caldera, $caldera), $args);
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
July 24th, 2005, 04:09 AM
post the whole code, it'll help with debugging.
July 24th, 2005, 10:53 PM
Got it working, thanks. You can see the demo at http://mygripe.net/ao_guys.php . Only works in Firefox at the moment.