API15

API15:JEditor/getInstance

From Joomla! Documentation

Revision as of 00:32, 25 March 2017 by JoomlaWikiBot (talk | contribs) (preparing for archive only)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

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

[<! removed edit link to red link >]

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

Syntax

& 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

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 edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

Code Examples