开发者

mainframe in Joomla

开发者 https://www.devze.com 2022-12-26 00:08 出处:网络
The hello world tutorial开发者_Go百科 for Joomla states: $mainframe is a global variable in Joomla that has lots of useful methods

The hello world tutorial开发者_Go百科 for Joomla states:

$mainframe is a global variable in Joomla that has lots of useful methods attached to it.

How do I find out what these methods are? I tried searching through their documentation, but I couldn't find any clues.


The $mainframe object is ultimately an instance the JApplication class. The JApplication class is defined in libraries/joomla/application/application.php. Depending on whether you're in the administrator or frontend section of Joomla, the $mainframe object is a direct instance of JAdministrator or JSite respectively. These classes are in includes/application.php and administrator/includes/application.php.


In joomla 2.5 global $mainframe is not accessible via global $mainframe. Use following code instead of global $mainframe.

$mainframe=JFactory::getApplication();

Visit this URl for more info

https://bitbucket.org/joomla/joomla-platform/raw/247ba8d88526096394c44dee8b9e5f4c7e315afc/libraries/joomla/application/application.php

0

精彩评论

暂无评论...
验证码 换一张
取 消