tags:

views:

373

answers:

1

The hello world tutorial 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.

+1  A: 

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.

jlleblanc
I searched the [class tree](http://api.joomla.org/classtrees_Joomla-Framework.html), but I can't find a a JSite or JAdministrator class
Casebash
That's where the divide between the CMS and the Framework lies. The class tree is showing *only* the framework. The $mainframe object gets defined in index.php at the application (CMS) level. I'm not finding any specific documentation on JSite or JAdministrator, but they both extend JApplication.
jlleblanc
@jileblanc: Do JSite or JAdministrator have any extra functions or are we supposed to just access them through the JApplication interface?
Casebash
Most of the functions in JSite and JAdministrator appear to be overrides of JApplication, but there are a few that appear only to be in JSite (like authorize()). It looks like there's some documentation missing here http://docs.joomla.org/JAdministrator and here http://docs.joomla.org/JSite. But there is documentation on JApplication here http://docs.joomla.org/JApplication.
jlleblanc
@jleb: If you use the @ when replying and at least the first 4 characters of the name then the other person will receive an alert that you have replied
Casebash
I decided to post a [new question](http://stackoverflow.com/questions/2604889/japplication-jadministrator-in-joomla) specifically on these classes
Casebash