API16

API16:JEditor/getInstance

From Joomla! Documentation

Description

Returns the global Editor object, only creating it if it doesn't already exist.


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

Syntax

static getInstance($editor= 'none')
Parameter Name Default Value Description
$editor 'none' $editor The editor to use.

Returns

The Editor object. 

Defined in

libraries/joomla/html/editor.php

Importing

jimport( 'joomla.html.editor' );

Source Body

public static function getInstance($editor = 'none')
{
        static $instances;

        if (!isset ($instances)) {
                $instances = array ();
        }

        $signature = serialize($editor);

        if (empty ($instances[$signature])) {
                $instances[$signature] = new JEditor($editor);
        }

        return $instances[$signature];
}


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

Examples

Code Examples