严格标准:非静态方法modJumiHelper::getCodeWritten()不应该静态调用



我在我的网站上有这些错误:

严格标准:非静态方法modJumiHelper::getCodeWritten()不应该在/home/kmxsiksf/www/modules/mod_jumi/mod_jumi.php第17行静态调用

严格标准:非静态方法modJumiHelper::getStorageSource()不应该在/home/kmxsiksf/www/modules/mod_jumi/mod_jumi.php第18行静态调用

这是mod_jumi.php(第17行和第18行分别以$code_written和$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了解不多,我找不到一种方法来使它们工作。

谢谢你的帮助!

此错误是由于函数getCodeWritten和getStorageSource不是静态函数。

而不是像这样声明:

public static function getCodeWritten()

它们被这样声明:

public function getCodeWritten()

要注意"修复"这个可能会导致其他问题。最好的办法是联系创建扩展的人。

相关内容

最新更新