API16

JApplication/initialise: Difference between revisions

From Joomla! Documentation

m clean up
m preparing for archive only
 
Line 55: Line 55:


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=initialise
  category=initialise
  category=JApplication
  category=JApplication
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*

Latest revision as of 01:18, 25 March 2017

Description

Initialise the application.


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

Syntax

initialise($options=array())
Parameter Name Default Value Description
$options array() An optional associative array of configuration settings.

Defined in

libraries/joomla/application/application.php

Importing

jimport( 'joomla.application.application' );

Source Body

public function initialise($options = array())
{
        jimport('joomla.plugin.helper');

        // Set the language in the class.
        $config = &JFactory::getConfig();

        // Check that we were given a language in the array (since by default may be blank).
        if (isset($options['language'])) {
                $config->setValue('config.language', $options['language']);
        }

        // Set user specific editor.
        $user   = &JFactory::getUser();
        $editor = $user->getParam('editor', $this->getCfg('editor'));
        $editor = JPluginHelper::isEnabled('editors', $editor) ? $editor : $this->getCfg('editor');
        $config->setValue('config.editor', $editor);

        // Trigger the onAfterInitialise event.
        JPluginHelper::importPlugin('system');
        $this->triggerEvent('onAfterInitialise');
}


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

Examples

Code Examples