I need to create a redirect with message in admin joomla component, I’m using joomla 2.5
and without MVC pattern.
This is my code
global $mainframe;
$mainframe->redirect('index.php?option=com_book','Message Saved');
But it’s generating a fatal Error
Fatal error: Call to a member function redirect() on a non-object in
Please help me out guys, you guys may be expert in joomla component devopment.
You get the error because Joomla! 2.5 doesn’t have a global
$mainframeobject, that is a hangover from Joomla 1.0 days. In Joomla! 1.5 it was a legacy support feature.You can use the the following to replace your
$mainframe:If you’re updating old code to work with Joomla! 2.5 you should read this article which covers these sorts of issues.