dosamigos\ckeditor\CKEditor::registerPlugin PHP Method

registerPlugin() protected method

Registers CKEditor plugin
protected registerPlugin ( )
    protected function registerPlugin()
    {
        $js = [];
        $view = $this->getView();
        CKEditorWidgetAsset::register($view);
        $id = $this->options['id'];
        $options = $this->clientOptions !== false && !empty($this->clientOptions) ? Json::encode($this->clientOptions) : '{}';
        $js[] = "CKEDITOR.replace('{$id}', {$options});";
        $js[] = "dosamigos.ckEditorWidget.registerOnChangeHandler('{$id}');";
        if (isset($this->clientOptions['filebrowserUploadUrl']) || isset($this->clientOptions['filebrowserImageUploadUrl'])) {
            $js[] = "dosamigos.ckEditorWidget.registerCsrfImageUploadHandler();";
        }
        $view->registerJs(implode("\n", $js));
    }

Usage Example

Example #1
1
 /**
  * Registers CKEditor plugin
  */
 protected function registerPlugin()
 {
     if ($this->enableKCFinder) {
         $this->registerKCFinder();
     }
     parent::registerPlugin();
 }
All Usage Examples Of dosamigos\ckeditor\CKEditor::registerPlugin