我是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
Run Code Online (Sandbox Code Playgroud)
Bak*_*ual 29
这很简单.您的模板调用名为getMenu()静态的函数.这意味着呼叫如下:$app::getMenu().但它看起来应该是这样的:$app->getMenu().变量name($app)无关紧要,冒号vs箭头很重要.
获取菜单的正确方法是:
$app = JFactory::getApplication();
$menu = $app->getMenu();
Run Code Online (Sandbox Code Playgroud)
甚至更短:
$menu = JFactory::getApplication()->getMenu();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
26016 次 |
| 最近记录: |