2014-06-24 71 views
0

叫我已经在我的网站这些错误:严格的标准:非静态方法modJumiHelper :: getCodeWritten()不应该静态

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

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

这里是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,我无法找到一种方法,使他们的工作很多解决方案。

非常感谢您的帮助!

回答

1

此错误是由于函数getCodeWritten和getStorageSource不是静态函数而引起的。

而不是被宣布像这样:

public static function getCodeWritten() 

他们被声明如下:

public function getCodeWritten() 

被警告说, “固定”,这可能会导致其他问题。您最好的选择是联系创建扩展的人员。

+0

感谢您的帮助!你的意思是getCodeWritten和getStorageSource在另一个.php – Enora

+0

@Arone是声明的。如果我是你,我会看看名为modJumiHelper的类文件。 –

+0

非常感谢,它的工作! (对于另一个在/modules/mod_jumi/helper.php中的第14行和第18行替换),以及如果您有类似的注意事项:严格标准:只有变量应该通过引用分配...删除所有这些“&”线。 – Enora

相关问题