Get menu from menuid - Joomla! Forum - community, help and support
i trying menu using menu id. menu not active menu.
i doing
$application = jfactory::getapplication();
$menu = $application->getmenu();
$item = $menu->getitem( '345');
it gives me error saying
fatal error: call member function getitem() on non-object in /home/imh/public_html/administrator/component.......
any hints appreciated.
thanks
i doing
$application = jfactory::getapplication();
$menu = $application->getmenu();
$item = $menu->getitem( '345');
it gives me error saying
fatal error: call member function getitem() on non-object in /home/imh/public_html/administrator/component.......
any hints appreciated.
thanks
nirmalthapa wrote:i trying menu using menu id. menu not active menu.
i doing
$application = jfactory::getapplication();
$menu = $application->getmenu();
$item = $menu->getitem( '345');
it gives me error saying
fatal error: call member function getitem() on non-object in /home/imh/public_html/administrator/component.......
any hints appreciated.
thanks
hi nirmalthapa,
it looks getitem() not instance of object. if defined value '345' does?
such as:
code: select all
$application = jfactory::getapplication();
$menu = $application->getmenu();
$itemid = jrequest::getint('id', '345');
$item = $menu->getitem($itemid);
now when var_dump($item), results , information related menu id of 345, means $item pulling correct information. i'm not php expert, love troubleshooting it. :-)
let me know if helps.
Comments
Post a Comment