JEditor/getInstance
From Joomla! Documentation
< API15:JEditor
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
The "API15" 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]
Returns a reference to a global Editor object, only creating it if it doesn't already exist.
Template:Description:JEditor/getInstance
Syntax[edit]
& getInstance($editor= 'none')
Parameter Name | Default Value | Description |
---|---|---|
$editor | 'none' | $editor The editor to use. |
Returns[edit]
The Editor object.
Defined in[edit]
libraries/joomla/html/editor.php
Importing[edit]
jimport( 'joomla.html.editor' );
Source Body[edit]
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];
}
[Edit See Also] Template:SeeAlso:JEditor/getInstance
Examples[edit]
<CodeExamplesForm />