Back to Editor class

Method getInstance

public static \Joomla\CMS\Editor\Editor
getInstance
(mixed $editor = 'none')
Returns the global Editor object, only creating it if it doesn't already exist.
Parameters
  • string $editor The editor to use.
Returns
  • \Joomla\CMS\Editor\Editor The Editor object.
Since
  • 1.5
Class: Editor
Project: Joomla

Method getInstance - Source code

/**
 * Returns the global Editor object, only creating it
 * if it doesn't already exist.
 *
 * @param   string  $editor  The editor to use.
 *
 * @return  Editor The Editor object.
 *
 * @since   1.5
 */
public static function getInstance($editor = 'none')
{
    $signature = serialize($editor);
    if (empty(self::$instances[$signature])) {
        self::$instances[$signature] = new static($editor);
    }
    return self::$instances[$signature];
}