API15:JFactory/getApplication
From Joomla! Documentation
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.
Contents |
Description
Get a application object
The object returned will be of a type derived from JApplication.
Syntax
& getApplication($id=null, $config=array(), $prefix='J')
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id A client identifier or name. |
| $config | array() | $config An optional associative array of configuration settings. |
| $prefix | 'J' |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
function &getApplication($id = null, $config = array(), $prefix='J') { static $instance; if (!is_object($instance)) { jimport( 'joomla.application.application' ); if (!$id) { JError::raiseError(500, 'Application Instantiation Error'); } $instance = JApplication::getInstance($id, $config, $prefix); } return $instance; }
[Edit See Also] SeeAlso:JFactory/getApplication
Examples
<CodeExamplesForm />
