JFactory :: getSession()和$ mainframe-> getSession()之间有什么区别(如果有)?


Answers:


7

全局变量$mainframe已在Joomla 1.6中删除,因此从该版本开始将无法使用。

global $mainframe应该替换为,$mainframe = JFactory::getApplication();但大多数人倾向于使用$app

因此,您的代码应如下所示:

$app = JFactory::getApplication();
$app->getSession();

希望这可以帮助


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.