10

我是joomla的新手。当我将模板更改为其他模板时,例如http://www.joomla24.com/Joomla_3x_Templates/Joomla_3x_Templates/Oliverio_Lite.html

我收到以下错误

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

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

2 回答 2

33

这很简单。您的模板调用一个getMenu()静态命名的函数。意思是调用看起来像这样:$app::getMenu(). 但它应该是这样的:$app->getMenu(). 变量名 ( $app) 无关紧要,冒号与箭头很重要。

获取菜单的正确方法是:

$app = JFactory::getApplication();
$menu = $app->getMenu();

甚至更短:

$menu = JFactory::getApplication()->getMenu();
于 2013-04-11T18:55:58.017 回答
-1

还要配置 php.ini error_reporting 作品

error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED
于 2020-05-07T17:36:19.643 回答