I\'m trying to add methods dynamically from external files.
Right now I have __call
method in my class so when i call the method I want, __call
inc
You can create an attribute in your class : methods=[]
and use create_function for create lambda function.
Stock it in the methods
attribute, at index of the name of method you want.
use :
function __call($method, $arguments)
{
if(method_exists($this, $method))
$this->$method($arguments);
else
$this->methods[$method]($arguments);
}
to find and call good method.