API16

Difference between revisions of "JFactory/getApplication"

From Joomla! Documentation

< API16:JFactory
(New page: ===Description=== Get a application object <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki...)
 
m (removing red link to edit, no existant pages)
Line 3: Line 3:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JFactory/getApplication|Edit Descripton]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
  
{{Description:JFactory/getApplication}}
+
<! removed transcluded page call, red link never existed >
  
 
===Syntax===
 
===Syntax===
Line 58: Line 58:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JFactory/getApplication|Edit See Also]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
{{SeeAlso:JFactory/getApplication}}
+
<! removed transcluded page call, red link never existed >
  
 
===Examples===
 
===Examples===
Line 73: Line 73:
 
  format= ,,,
 
  format= ,,,
 
</dpl>
 
</dpl>
 +
[[Category:Archived pages API16]]

Revision as of 00:06, 13 May 2013

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

Get a application object

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax[edit]

static 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[edit]

object

Defined in[edit]

libraries/joomla/factory.php

Importing[edit]

jimport( 'joomla.factory' );

Source Body[edit]

public static function getApplication($id = null, $config = array(), $prefix='J')
{
        if (!is_object(JFactory::$application))
        {
                jimport('joomla.application.application');

                if (!$id) {
                        JError::raiseError(500, 'Application Instantiation Error');
                }

                JFactory::$application = JApplication::getInstance($id, $config, $prefix);
        }

        return JFactory::$application;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples[edit]

<CodeExamplesForm />