クラスのプロパティの値を動的メソッド名として使用する必要がありますが、次のようになります。
Catchable fatal error: Object of class dispatcher could not be converted to string in ...
私がやりたいことは次のとおりです。
class test {
var $objectname = "object_name";
var $methodname = "method";
public function test_method() {
require_once("some_class_file");
// Here is where I am falling out:
$some_object = new $this->objectname();
$some_object->$this->methodname();
}
}
つまり、クラスの既存のプロパティからオブジェクト名と潜在的なメソッドを動的に設定したいと考えています。
何か案は?