I need to make a universal caller for addons to my php project. I need to call models based on form field (POST):
$moduleName = new ReflectionClass($module);
$data = $moduleName->method($params);
print_r($data);
This also doesn't work:
$data = call_user_func_array($moduleName.'::method',array($params));
print_r($data);
Why?
Is this right? I get ReflectionClass:method() 'not found or invalid function name' error.
How to call a new instance of the class by name from variable and function name also as variable?