严格标准:非静态方法(joomla和roksprocket) [英] Strict Standards: Non-static method (joomla and roksprocket)

查看:113
本文介绍了严格标准:非静态方法(joomla和roksprocket)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Strict Standards: Non-static method K2ModelItemlist::getCategoryTree() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\virgin\components\com_roksprocket\lib\RokSprocket\Provider\K2\Filter.php on line 151

全部

我遇到此错误...我正在使用RokSprocket,Joomla并收到上述错误...似乎源自

I have this error...I am using RokSprocket, Joomla and received the above error... It seems to have originated from

protected function category($data)
{
if(file_exists(JPATH_SITE.'/components/com_k2/models/itemlist.php'))
require_once (JPATH_SITE.'/components/com_k2/models/itemlist.php');
$wheres = array();
foreach($data as $match){
$categories = K2ModelItemlist::getCategoryTree($match);

任何想法如何解决此问题.

Any idea how to fix this.

推荐答案

使Joomla符合严格要求的工作仍在进行中.核心已经走了很长一段路,但是许多扩展开发人员仍然不了解当前的最佳实践.

Making Joomla compatible with the strict requirements are still work in progress. The core has come a long way on that road, but many extension developers are still not aware of current best practices.

保持最大的error_level,只需在function关键字前加上public static来修复损坏的代码.您将在更新时松开它,但是您的VCS将帮助您快速重新修复它.

Stay with the maximum error_level, just repair the broken code by prepending the function keyword with public static. You'll loose that on updates, but your VCS will help you to re-fix that quickly.

在生产系统上,可以降低error_reporting以不包含严格的警告.配置服务器以记录错误而不是显示错误.

On productive systems, error_reporting can be lowered to not include strict warnings. Configure the server to log errors instead of displaying them.

这篇关于严格标准:非静态方法(joomla和roksprocket)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆