I have a problem's. I want to call a staticclass method from another class. The class name and method are created dynamically.
This is not so difficult to do:
$class = 'className';
$method = 'method';
$data = $class::$method();
BUT I want to do it like this
class abc {
static public function action() {
}
}
class xyz {
protected $method = 'action';
protected $class = 'abc';
public function test(){
$data = $this->class::$this->method();
}
}
And this does not work unless I assign to a $this->classvariable $classand a $this->methodvariable $method. What is the problem?
source
share