Error $mainframe->set() in joomla 1.7
I have code in joomla 1.5
global $mainframe;
$html = "web solution";
$mainframe->set('JComponentTitle', $html);
Us开发者_运维百科e in joomla 1.5 is OK
But when using joomla 1.7 is error Call to a member function set() on a non-object in ...
I want help for this idea
Try this:
global $app;
$html = "web solution";
$app->set('JComponentTitle', $html);
I think the using of global objects in joomla 1.6+ is deprecated. Instead of using $mainframe and global $app, I'd use something like :
$app = & JFactory::getApplication();
$html = 'web solution';
$app->set('JComponentTitle', $html);
精彩评论