严格标准:不应静态调用非静态方法modJumiHelper :: getCodeWritten() [英] Strict Standards: Non-static method modJumiHelper::getCodeWritten() should not be called statically
问题描述
我的网站上出现以下错误:
I having these errors on my website:
严格的标准:不应在第17行的/home/kmxsiksf/www/modules/mod_jumi/mod_jumi.php中静态调用非静态方法modJumiHelper :: getCodeWritten().
Strict Standards: Non-static method modJumiHelper::getCodeWritten() should not be called statically in /home/kmxsiksf/www/modules/mod_jumi/mod_jumi.php on line 17
严格的标准:不应在第18行的/home/kmxsiksf/www/modules/mod_jumi/mod_jumi.php中静态调用非静态方法modJumiHelper :: getStorageSource().
Strict Standards: Non-static method modJumiHelper::getStorageSource() should not be called statically in /home/kmxsiksf/www/modules/mod_jumi/mod_jumi.php on line 18
这是mod_jumi.php(第17行和第18行分别以$ code_write和$ storage_source开头)
Here is the mod_jumi.php (line 17 and 18 start respectively with $code_written and $storage_source)
defined('_JEXEC') or die('Restricted access');
if(!defined('DS')){
define('DS',DIRECTORY_SEPARATOR);
}
// Include the functions only once
require_once(dirname(__FILE__).DS.'helper.php');
$code_written = modJumiHelper::getCodeWritten($params); //code written or ""
$storage_source = modJumiHelper::getStorageSource($params); //filepathname or record id or ""
if(is_int($storage_source)) { //it is record id
$code_stored = modJumiHelper::getCodeStored($storage_source); //code or null(error]
}
require(JModuleHelper::getLayoutPath('mod_jumi'));
我找到了很多解决此问题的方法,可以将函数转换为非静态函数,但是由于我对PHP不太了解,所以找不到找到使它们起作用的方法.
I found many solution for this problem to transform the function into a non static one but because I don't know much about PHP, I couldn't find a way to make them work.
非常感谢您的帮助!
推荐答案
由于函数getCodeWritten和getStorageSource不是静态函数而导致此错误.
This error is caused because the functions getCodeWritten and getStorageSource are not static functions.
即
与其像这样声明:
public static function getCodeWritten()
它们被这样声明:
public function getCodeWritten()
请注意,修复"这可能会导致其他问题.最好的办法是与创建扩展的人员联系.
Be warned that "fixing" this might cause other issues. Your best bet is to contact the people who created the extension.
这篇关于严格标准:不应静态调用非静态方法modJumiHelper :: getCodeWritten()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!