Hi PhpFreaks,
I have a method that I need to be initialised dynamically and I am not sure if the code below will work I have been able to workout if the method exists
but I have not found a way to it get to return the array. Has anyone go any ideas?
The error I get is: Catchable fatal error: Object of class Forms could not be converted to string
public function setMethodForms($methodName){
echo $methodName." and does it exist ". (int)method_exists($this->formsObj, $methodName);
//test to see if the method exists
if ((int)method_exists($this->formsObj, $methodName) == 1){
//if it does execute
//print_r ($this->formsObj->projects()); //test to see if object works
$return call_user_func($this->formsObj."->".$methodName."()");
}
return $return;
}