Bundle/MediaBundle/Resources/public/js/ckeditor/ckeditor_php5.php
public function replaceAll($className = null)
    {
        $out = '';
        if (!$this->initialized) {
            $out .= $this->init();
        }

        $_config = $this->configSettings();

        $js = $this->returnGlobalEvents();
        if (empty($_config)) {
            if (empty($className)) {
                $js .= 'CKEDITOR.replaceAll();';
            } else {
                $js .= "CKEDITOR.replaceAll('".$className."');";
            }
        } else {
            $classDetection = '';
            $js .= "CKEDITOR.replaceAll( function (textarea, config) {\n";
            if (!empty($className)) {
                $js .= "	var classRegex = new RegExp('(?:^| )' + '".$className."' + '(?:$| )');\n";
                $js .= "	if (!classRegex.test(textarea.className))\n";
                $js .= "		return false;\n";
            }
            $js .= '	CKEDITOR.tools.extend(config, '.$this->jsEncode($_config).', true);';
            $js .= '} );';
        }

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

        if (!$this->returnOutput) {
            echo $out;
            $out = '';
        }

        return $out;
    }
public function replaceAll($className = null)
    {
        $out = '';
        if (!$this->initialized) {
            $out .= $this->init();
        }

        $_config = $this->configSettings();

        $js = $this->returnGlobalEvents();
        if (empty($_config)) {
            if (empty($className)) {
                $js .= 'CKEDITOR.replaceAll();';
            } else {
                $js .= "CKEDITOR.replaceAll('".$className."');";
            }
        } else {
            $classDetection = '';
            $js .= "CKEDITOR.replaceAll( function (textarea, config) {\n";
            if (!empty($className)) {
                $js .= "	var classRegex = new RegExp('(?:^| )' + '".$className."' + '(?:$| )');\n";
                $js .= "	if (!classRegex.test(textarea.className))\n";
                $js .= "		return false;\n";
            }
            $js .= '	CKEDITOR.tools.extend(config, '.$this->jsEncode($_config).', true);';
            $js .= '} );';
        }

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

        if (!$this->returnOutput) {
            echo $out;
            $out = '';
        }

        return $out;
    }
public function replaceAll ( $ className = null ) { $ out = '' ; if ( ! $ this -> initialized ) { $ out .= $ this -> init ( ) ; } $ _config = $ this -> configSettings ( ) ; $ js = $ this -> returnGlobalEvents ( ) ; if ( empty ( $ _config ) ) { if ( empty ( $ className ) ) { $ js .= 'CKEDITOR.replaceAll();' ; } else { $ js .= "CKEDITOR.replaceAll('" . $ className . "');" ; } } else { $ classDetection = '' ; $ js .= "CKEDITOR.replaceAll( function (textarea, config) {\n" ; if ( ! empty ( $ className ) ) { $ js .= "	var classRegex = new RegExp('(?:^| )' + '" . $ className . "' + '(?:$| )');\n" ; $ js .= "	if (!classRegex.test(textarea.className))\n" ; $ js .= "		return false;\n" ; } $ js .= '	CKEDITOR.tools.extend(config, ' . $ this -> jsEncode ( $ _config ) . ', true);' ; $ js .= '} );' ; } $ out .= $ this -> script ( $ js ) ; if ( ! $ this -> returnOutput ) { echo $ out ; $ out = '' ; } return $ out ; }
Replace all &lt;textarea&gt; elements available in the document with editor instances.

@param $className (string) If set, replace all textareas with class className in the page.

Example 1: replace all &lt;textarea&gt; elements in the page.
@code
$CKEditor = new CKEditor();
$CKEditor->replaceAll();
@endcode

Example 2: replace all &lt;textarea class="myClassName"&gt; elements in the page.
@code
$CKEditor = new CKEditor();
$CKEditor->replaceAll( 'myClassName' );
@endcode
Replace all &lt ; textarea&gt ; elements available in the document with editor instances .