0

このブラウザ エラーが発生し続けます

Strict Standards: Non-static method JSite::getMenu() should not be called statically, 
assuming $this from incompatible context 
in C:\xampp\htdocs\afvidz\templates\videoplus\index.php on line 53`

Strict Standards: Non-static method JApplication::getMenu() should not be called statically, 
assuming $this from incompatible context 
in C:\xampp\htdocs\afvidz\includes\application.php on line 593`

これが私の53行目です

$menu = JSite::getMenu();

そして593行目

$menu = parent::getMenu('site', $options);
4

2 に答える 2

1

あなたは静的な方法でオブジェクトメソッドを呼び出そうとしています(クラスメソッド)

$object - new JSite;
$menu = $object->getMenu();
于 2013-08-06T15:00:28.300 に答える
1

getMenu静的メソッドの場合、likeを呼び出すことはできません。

やったほうがいい :

$object = new JSite;             // First you create an object
$menu = $object->getMenu();      // Finally you call getMenu

ドキュメントをチェックして、staticメソッドとは何かを確認してください: http://www.php.net/manual/en/language.oop5.static.php

また、このリンクはあなたの場合に非常に役立ちます: http://www.php.net/manual/en/language.oop5.basic.php (2番目の例をチェックしてください)。

于 2013-08-06T15:03:08.690 に答える