Abstract Class JApplication

Description

Base class for a Joomla! application.

Acts as a Factory class for application specific objects and provides many supporting API functions. Derived clases should supply the route(), dispatch() and render() functions.

  • abstract:
  • since: 1.5

Located in /libraries/joomla/application/application.php (line 30)

JObject
   |
   --JApplication
Direct descendents
Class Description
 class JAdministrator Joomla! Application class
 class Joomla! Application class
 class JXMLRPC Joomla! XML-RPC Application class
 class JInstallation Joomla! Application class
 class mosMainFrame Legacy class, derive from JApplication instead
Variable Summary
 string $scope
 integer $_clientId
 array $_name
Method Summary
 static void registerEvent (string $event, mixed $handler)
 static array triggerEvent (string $event, [array $args = null])
 JApplication __construct ([integer $config = array()])
 void addCustomHeadTag (string $html)
 void addMetaTag (string $name, string $content, [string $prepend = ''], [string $append = ''])
 void appendMetaTag (string $name, string $content)
 void appendPathWay ( $name, [ $link = null])
 void close ([int $code = 0])
 void dispatch ( $component)
 void enqueueMessage (string $msg, [string $type = 'message'])
 void getBasePath ([ $client = 0], [ $addTrailingSlash = true])
 mixed getCfg (string $varname)
 int getClientId ()
 void getHead ()
 JApplication &getInstance ( $client, [array $config = array()], [ $prefix = 'J'], mixed $id)
 void getItemid ( $id)
 JMenu. &getMenu ([ $name = null], [array $options = array()])
 string getName ()
 void getPageTitle ()
 void getPath ( $varname, [ $user_option = null])
 JPathway. &getPathway ([ $name = null], [array $options = array()])
 JRouter. &getRouter ([ $name = null], [array $options = array()])
 string getTemplate ()
 void &getUser ()
 mixed getUserState (string $key)
 The getUserStateFromRequest (string $key, string $request, [string $default = null], [string $type = 'none'])
 void initialise ([array $options = array()])
 boolean isAdmin ()
 boolean isSite ()
 boolean login (array $credentials, [array $options = array()])
 void logout ([int $userid = null], [array $options = array()])
 void prependMetaTag (string $name, string $content)
 none; redirect (string $url, [string $msg = ''], [string $msgType = 'message'])
 void render ()
 void route ()
 void setPageTitle ([ $title = null])
 mixed setUserState (string $key, string $value)
Variables
string $scope = null (line 63)

The scope of the application

  • access: public
integer $_clientId = null (line 39)

The client identifier.

  • since: 1.5
  • access: protected
array $_messageQueue = array() (line 47)

The application message queue.

  • access: protected
array $_name = null (line 55)

The name of the application

  • access: protected

Inherited Variables

Inherited from JObject

JObject::$_errors
Methods
static registerEvent (line 483)

Registers a handler to a particular event group.

  • since: 1.5
void registerEvent (string $event, mixed $handler)
  • string $event: The event name.
  • mixed $handler: The handler, a function or an instance of a event object.
static triggerEvent (line 498)

Calls all handlers associated with an event group.

  • return: An array of results from each function call.
  • since: 1.5
array triggerEvent (string $event, [array $args = null])
  • string $event: The event name.
  • array $args: An array of arguments.
Constructor __construct (line 70)

Class constructor.

JApplication __construct ([integer $config = array()])
  • integer $config: A client identifier.

Redefinition of:
JObject::__construct()
Class constructor, overridden in descendant classes.

Redefined in descendants as:
addCustomHeadTag (line 951)

Deprecated, use JDocument->addCustomTag instead (only when document type is HTML).

void addCustomHeadTag (string $html)
  • string $html: Valid HTML
addMetaTag (line 909)

Deprecated, use JDocument->setMetaData instead.

void addMetaTag (string $name, string $content, [string $prepend = ''], [string $append = ''])
  • string $name: Name of the metadata tag
  • string $content: Content of the metadata tag
  • string $prepend: Deprecated, ignored
  • string $append: Deprecated, ignored
appendMetaTag (line 924)

Deprecated, use JDocument->setMetaData instead.

void appendMetaTag (string $name, string $content)
  • string $name: Name of the metadata tag
  • string $content: Content of the metadata tag
appendPathWay (line 834)

Deprecated, use JPathWay->addItem() method instead.

  • see: JPathWay::addItem()
  • deprecated: As of version 1.5
  • since: 1.0
void appendPathWay ( $name, [ $link = null])
  • $name
  • $link
close (line 249)

Exit the application.

  • access: public
void close ([int $code = 0])
  • int $code: Exit code
dispatch (line 209)

Dispatch the applicaiton.

Dispatching is the process of pulling the option from the request object and mapping them to a component. If the component does not exist, it handles determining a default component to dispatch.

  • abstract:
  • access: public
void dispatch ( $component)
  • $component

Redefined in descendants as:
enqueueMessage (line 335)

Enqueue a system message.

  • since: 1.5
  • access: public
void enqueueMessage (string $msg, [string $type = 'message'])
  • string $msg: The message to enqueue.
  • string $type: The message type.
getBasePath (line 1039)

Deprecated, use JURI::base() instead.

  • see: JURI::base()
  • deprecated: As of version 1.5
  • since: 1.0
void getBasePath ([ $client = 0], [ $addTrailingSlash = true])
  • $client
  • $addTrailingSlash

Redefined in descendants as:
getBlogCategoryCount (line 977)

Deprecated.

  • deprecated: As of version 1.5
  • since: 1.0
void getBlogCategoryCount ()
getBlogSectionCount (line 965)

Deprecated.

  • deprecated: As of version 1.5
  • since: 1.0
void getBlogSectionCount ()
getCfg (line 381)

Gets a configuration value.

  • return: The user state.
  • access: public
  • example: example not found
mixed getCfg (string $varname)
  • string $varname: The name of the value to get.
getClientId (line 794)

Gets the client id of the current running application.

  • return: A client identifier.
  • since: 1.5
  • access: public
int getClientId ()
getContentItemLinkCount (line 1013)

Deprecated.

  • deprecated: As of version 1.5
  • since: 1.0
void getContentItemLinkCount ()
getCustomPathWay (line 878)

Deprecated, use JPathway->getPathWayNames() method instead.

  • see: JPathWay::getPathWayNames()
  • deprecated: As of version 1.5
  • since: 1.0
void getCustomPathWay ()
getGlobalBlogSectionCount (line 989)

Deprecated.

  • deprecated: As of version 1.5
  • since: 1.0
void getGlobalBlogSectionCount ()
getHead (line 892)

Deprecated, use JDocument->get( 'head' ) instead.

  • see: JObject::get()
  • see: JDocument @
  • deprecated: As of version 1.5
  • since: 1.0
void getHead ()
getInstance (line 117)

Returns a reference to the global JApplication object, only creating it if it doesn't already exist.

This method must be invoked as:

  $menu = &JApplication::getInstance();

  • return: The appliction object.
  • since: 1.5
  • access: public
JApplication &getInstance ( $client, [array $config = array()], [ $prefix = 'J'], mixed $id)
  • mixed $id: A client identifier or name.
  • array $config: An optional associative array of configuration settings.
  • $client
  • $prefix
getItemid (line 1064)

Deprecated, use ContentHelper::getItemid instead.

void getItemid ( $id)
  • $id
getMenu (line 693)

Return a reference to the application JPathway object.

  • since: 1.5
  • access: public
JMenu. &getMenu ([ $name = null], [array $options = array()])
  • array $options: An optional associative array of configuration settings.
  • $name

Redefined in descendants as:
getMessageQueue (line 358)

Get the system message queue.

  • return: system message queue.
  • since: 1.5
  • access: public
The getMessageQueue ()
getName (line 397)

Method to get the application name

The dispatcher name by default parsed using the classname, or it can be set by passing a $config['name'] in the class constructor

  • return: The name of the dispatcher
  • since: 1.5
  • access: public
string getName ()
getPageTitle (line 1104)

Deprecated, use JDocument::getTitle instead.

void getPageTitle ()

Redefined in descendants as:
getPath (line 1026)

Deprecated, use JApplicationHelper::getPath instead.

void getPath ( $varname, [ $user_option = null])
  • $varname
  • $user_option
getPathway (line 670)

Return a reference to the application JPathway object.

  • since: 1.5
  • access: public
JPathway. &getPathway ([ $name = null], [array $options = array()])
  • array $options: An optional associative array of configuration settings.
  • $name
getRouter (line 647)

Return a reference to the application JRouter object.

  • since: 1.5
  • access: public
JRouter. &getRouter ([ $name = null], [array $options = array()])
  • array $options: An optional associative array of configuration settings.
  • $name

Redefined in descendants as:
getStaticContentCount (line 1001)

Deprecated.

  • deprecated: As of version 1.5
  • since: 1.0
void getStaticContentCount ()
getTemplate (line 634)

Gets the name of the current template.

string getTemplate ()

Redefined in descendants as:
getUser (line 1051)

Deprecated, use JFactory::getUser instead.

void &getUser ()
getUserState (line 420)

Gets a user state.

  • return: The user state.
  • access: public
mixed getUserState (string $key)
  • string $key: The path of the state.
getUserStateFromRequest (line 458)

Gets the value of a user state variable.

  • return: request user state.
  • access: public
The getUserStateFromRequest (string $key, string $request, [string $default = null], [string $type = 'none'])
  • string $key: The key of the user state variable.
  • string $request: The name of the variable passed in a request.
  • string $default: The default value for the variable if not found. Optional.
  • string $type: Filter for the variable, for valid values see JFilterInput::clean(). Optional.
initialise (line 158)

Initialise the application.

  • access: public
void initialise ([array $options = array()])
  • array $options: An optional associative array of configuration settings.

Redefined in descendants as:
isAdmin (line 806)

Is admin interface?

  • return: True if this application is administrator.
  • since: 1.0.2
  • access: public
boolean isAdmin ()
isSite (line 818)

Is site interface?

  • return: True if this application is site.
  • since: 1.5
  • access: public
boolean isSite ()
login (line 522)

Login authentication function.

Username and encoded password are passed the the onLoginUser event which is responsible for the user validation. A successful validation updates the current session record with the users details.

Username and encoded password are sent as credentials (along with other possibilities) to each observer (authentication plugin) for user validation. Successful validation will update the current session with the user details.

  • return: True on success.
  • since: 1.5
  • access: public
boolean login (array $credentials, [array $options = array()])
  • array $credentials: Array( 'username' => string, 'password' => string )
  • array $options: Array( 'remember' => boolean )

Redefined in descendants as:
logout (line 589)

Logout authentication function.

Passed the current user information to the onLogoutUser event and reverts the current session record back to 'anonymous' parameters.

  • access: public
void logout ([int $userid = null], [array $options = array()])
  • int $userid: The user to load - Can be an integer or string - If string, it is converted to ID automatically
  • array $options:

    Array( 'clientid' => array of client id's )

prependMetaTag (line 938)

Deprecated, use JDocument->setMetaData instead

void prependMetaTag (string $name, string $content)
  • string $name: Name of the metadata tag
  • string $content: Content of the metadata tag
redirect (line 270)

Redirect to another URL.

Optionally enqueues a message in the system message queue (which will be displayed the next time a page is loaded) using the enqueueMessage method. If the headers have not been sent the redirect will be accomplished using a "301 Moved Permanently" code in the header pointing to the new location. If the headers have already been sent this will be accomplished using a JavaScript statement.

none; redirect (string $url, [string $msg = ''], [string $msgType = 'message'])
  • string $url: The URL to redirect to. Can only be http/https URL
  • string $msg: An optional message to display on redirect.
  • string $msgType: An optional message type.
render (line 230)

Render the application.

Rendering is the process of pushing the document buffers into the template placeholders, retrieving data from the document and pushing it into the JResponse buffer.

  • abstract:
  • access: public
void render ()

Redefined in descendants as:
route (line 188)

Route the application.

Routing is the process of examining the request environment to determine which component should receive the request. The component optional parameters are then set in the request object to be processed when the application is being dispatched.

  • abstract:
  • access: public
void route ()

Redefined in descendants as:
setPageTitle (line 1091)

Deprecated, use JDocument::setTitle instead.

void setPageTitle ([ $title = null])
  • $title

Redefined in descendants as:
setUserState (line 438)

Sets the value of a user state variable.

  • return: The previous state, if one existed.
  • access: public
mixed setUserState (string $key, string $value)
  • string $key: The path of the state.
  • string $value: The value of the variable.

Inherited Methods

Inherited From JObject

 JObject::JObject()
 JObject::__construct()
 JObject::get()
 JObject::getError()
 JObject::getErrors()
 JObject::getProperties()
 JObject::getPublicProperties()
 JObject::set()
 JObject::setError()
 JObject::setProperties()
 JObject::toString()

Documentation generated on Thu, 12 Nov 2009 13:56:43 +0100 by phpDocumentor 1.4.2