I use ckeditor from 2amigos.

How to install plugins in this widget?

For example, I want to install the plugin Spoiler

how should it look like in a project?

  • Please write which plugin you are using - Urmuz Tagizade
  • ckeditor by amigos - des1roer

1 answer 1

  1. First you need to create a new folder in @webroot of your project. For example, let's call the folder ckeditor . Inside this folder, create a folder of plugins and throw all the plugins that we want to use for further work.

  2. In the folder created by us we create config.js with contents

    CKEDITOR.plugins.basePath = '/ckeditor/plugins/'; CKEDITOR.editorConfig = function( config ) { config.extraPlugins = 'spoiler'; }; 
  3. In the view when connecting configure:

     <?= $form->field($model, 'text')->widget(CKEditor::className(), ['preset' => 'standart', 'clientOptions' => [ 'customConfig' => '/ckeditor/config.js', ]]) ?> 

PS You can customize the folder structure and the name of the configuration file at your discretion.

enter image description here

  • What to consider a vebrut in a basic pattern? Can I have a screen of the file system? - des1roer
  • webroot is a web folder - Urmuz Tagizade
  • and when downloading, suppose the spoiler is downloaded two folders - spoiler and includ. What system should be spoiler-plug-ins spoiler and includ? - des1roer
  • web / ckeditor / plugins / spoiler / ... - Urmuz Tagizade
  • I have a project screen attached. what to lay down? - des1roer