asklogic extends baselogic
asklogic 有个属性 static::$model
是个askmodel对象
askmodel extends basemodel
但是static::$model调用不了 basemodel里的方法
还有。。使用这种方法在__call里调用的
$data = call_user_func_array([static::$model, $method], $arguments);
求解
语言php
框架tp
asklogic extends baselogic
asklogic 有个属性 static::$model
是个askmodel对象
askmodel extends basemodel
但是static::$model调用不了 basemodel里的方法
还有。。使用这种方法在__call里调用的
$data = call_user_func_array([static::$model, $method], $arguments);
求解
语言php
框架tp
谢邀
我很久木有用TP了 对TP不熟 我帮你邀请了我的一个朋友@白俊遥 他对TP很熟 希望他能解决你的问题
public static $model是你自己定义的吧?$model并没有赋值当然不能调用了,通常是这样写的。
<code>class A {
protected static $model;
public static function getModelInstance() {
if (empty(static::$model)) static::$model = new YourClass();
return static::$model;
}
}
//call
echo A::getModelInstance()->method();</code>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号