Actions

CodeExample

4dade689c06c7

From Joomla! Documentation

Revision as of 14:46, 19 April 2011 by Chris Davenport (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Example

This method is most often used to get a reference to the global application object, in which case it can be called with no arguments. In this example, the application object is obtained so that a test can be made to see if the code is running on the front-end (client is 'site') or the back-end (client is 'administrator').

$app =& JFactory::getApplication();
if ($app->isSite())  echo 'Client is site';
if ($app->isAdmin()) echo 'Client is administrator';
Chris Davenport 14:46, 19 April 2011 (CDT) Edit comment