invokeClass
用法:可以不传命名空间实例化 (通过反射实例化)
obj=Container::getInstance()−>invokeClass(InvokerTest::class);vardump(obj = Container::getInstance()->invokeClass(InvokerTest::class);
var_dump(obj=Container::getInstance()−>invokeClass(InvokerTest::class);vardump(obj->invokerNews());die;
invokeMethod
用法:传入带命名空间的类和对应方法,实例化后调用该方法
KaTeX parse error: Expected 'EOF', got '\common' at position 55: …okeMethod(["app\̲c̲o̲m̲m̲o̲n̲\service\Invoke…methods);die;
invokeFunction
用法:可以执行自定义的函数和闭包,参数以数组形式传递
functions=Container::getInstance()−>invokeFunction(function(functions = Container::getInstance()->invokeFunction(function (functions=Container::getInstance()−>invokeFunction(function(name) {
return "hello {KaTeX parse error: Expected 'EOF', got '}' at position 5: name}̲";
}, ["beiqi…functions);die;
functions=Container::getInstance()−>invokeFunction("procmsg",["12312","heillo"]);vardump(functions = Container::getInstance()->invokeFunction("procmsg", ["12312", "heillo"]); var_dump(functions=Container::getInstance()−>invokeFunction("procmsg",["12312","heillo"]);vardump(functions);die;
invoke
用法:invokeFunction 和 invokeMethod 结合体
KaTeX parse error: Expected 'EOF', got '\common' at position 48: …)->invoke(["app\̲c̲o̲m̲m̲o̲n̲\service\Invoke…invoke);die;