Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strict Standards: Non-static method JSite::getMenu() should not be called statically

Tags:

joomla3.0

I'm a newbee in joomla. When I change my template to other like http://www.joomla24.com/Joomla_3x_Templates/Joomla_3x_Templates/Oliverio_Lite.html

I'm getting the following error

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
like image 405
selva Avatar asked Apr 10 '13 09:04

selva


1 Answers

It's quite simple. Your template calls a function named getMenu() statically. Meaning the call looks like this: $app::getMenu(). But it should look like this: $app->getMenu(). The variable name ($app) doesn't matter, the colon vs arrow matters.

The correct way to get the menu is:

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

or even shorter:

$menu = JFactory::getApplication()->getMenu();
like image 180
Bakual Avatar answered Nov 10 '22 15:11

Bakual