在 joomla 6 中,adminmodel 中的 getitem() 方法将返回 stdclass 而不是 cmsobject。 这意味着该类的所有已弃用的功能将不可用。 joomla 6 中的开发人员应该直接使用 item 对象的属性,而不是使用过时的 set() 和 get() 方法。
$article = $app->bootcomponent('content')->getmvcfactory()->createmodel('article', 'administrator')->getitem(1); echo $article->get('title');
$article = $app->bootComponent('content')->getMVCFactory()->createModel('Article', 'Administrator')->getItem(1); echo $article->title;
相应的 pull request 已被 joomla 6 分支接受。
joomla github 上的公关
以上就是为 Joomla CMSObject -> stdClass 准备扩展的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号