
thinkphp6 的 db::name() 方法静态调用提示错误
问题:
使用 thinkphp6 中的 db::name('name') 方法时出现提示:
Non-static method 'name' should not be called statically less...
解答:
立即学习“PHP免费学习笔记(深入)”;
此错误提示表明非静态方法不能以静态方式调用。这是因为 name() 方法不是 db 类的静态方法。
解决方案:
安装以下插件以解决此问题:
安装插件后,问题即可解决。
以上就是ThinkPHP6中Db::name()方法静态调用报错该如何解决?的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号