function editor($name, $value = "", $config = array(), $events = array())
	{
		$attr = "";
		foreach ($this->textareaAttributes as $key => $val) {
			$attr.= " " . $key . '="' . str_replace('"', '&quot;', $val) . '"';
		}
		$out = "<textarea name=\"" . $name . "\"" . $attr . ">" . htmlspecialchars($value) . "</textarea>\n";
		if (!$this->initialized) {
			$out .= $this->init();
		}

		$_config = $this->configSettings($config, $events);

		$js = $this->returnGlobalEvents();
		if (!empty($_config))
			$js .= "CKEDITOR.replace('".$name."', ".$this->jsEncode($_config).");";
		else
			$js .= "CKEDITOR.replace('".$name."');";

		$out .= $this->script($js);

		if (!$this->returnOutput) {
			print $out;
			$out = "";
		}

		return $out;
	}
function editor($name, $value = "", $config = array(), $events = array())
	{
		$attr = "";
		foreach ($this->textareaAttributes as $key => $val) {
			$attr.= " " . $key . '="' . str_replace('"', '&quot;', $val) . '"';
		}
		$out = "<textarea name=\"" . $name . "\"" . $attr . ">" . htmlspecialchars($value) . "</textarea>\n";
		if (!$this->initialized) {
			$out .= $this->init();
		}

		$_config = $this->configSettings($config, $events);

		$js = $this->returnGlobalEvents();
		if (!empty($_config))
			$js .= "CKEDITOR.replace('".$name."', ".$this->jsEncode($_config).");";
		else
			$js .= "CKEDITOR.replace('".$name."');";

		$out .= $this->script($js);

		if (!$this->returnOutput) {
			print $out;
			$out = "";
		}

		return $out;
	}
function editor ( $ name , $ value = "" , $ config = array ( ) , $ events = array ( ) ) { $ attr = "" ; foreach ( $ this -> textareaAttributes as $ key => $ val ) { $ attr .= " " . $ key . '="' . str_replace ( '"' , '&quot;' , $ val ) . '"' ; } $ out = "<textarea name=\"" . $ name . "\"" . $ attr . ">" . htmlspecialchars ( $ value ) . "</textarea>\n" ; if ( ! $ this -> initialized ) { $ out .= $ this -> init ( ) ; } $ _config = $ this -> configSettings ( $ config , $ events ) ; $ js = $ this -> returnGlobalEvents ( ) ; if ( ! empty ( $ _config ) ) $ js .= "CKEDITOR.replace('" . $ name . "', " . $ this -> jsEncode ( $ _config ) . ");" ; else $ js .= "CKEDITOR.replace('" . $ name . "');" ; $ out .= $ this -> script ( $ js ) ; if ( ! $ this -> returnOutput ) { print $ out ; $ out = "" ; } return $ out ; }
Creates a %CKEditor instance.
In incompatible browsers %CKEditor will downgrade to plain HTML &lt;textarea&gt; element.

@param $name (string) Name of the %CKEditor instance (this will be also the "name" attribute of textarea element).
@param $value (string) Initial value (optional).
@param $config (array) The specific configurations to apply to this editor instance (optional).
@param $events (array) Event listeners for this editor instance (optional).

Example usage:
@code
$CKEditor = new CKEditor();
$CKEditor->editor("field1", "<p>Initial value.</p>");
@endcode

Advanced example:
@code
$CKEditor = new CKEditor();
$config = array();
$config['toolbar'] = array(
array( 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike' ),
array( 'Image', 'Link', 'Unlink', 'Anchor' )
);
$events['instanceReady'] = 'function (ev) {
alert("Loaded: " + ev.editor.name);
}';
$CKEditor->editor("field1", "<p>Initial value.</p>", $config, $events);
@endcode
Creates a %CKEditor instance . In incompatible browsers %CKEditor will downgrade to plain HTML &lt ; textarea&gt ; element .