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
精彩评论