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?
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.
In the folder created by us we create config.js with contents
CKEDITOR.plugins.basePath = '/ckeditor/plugins/'; CKEDITOR.editorConfig = function( config ) { config.extraPlugins = 'spoiler'; }; 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.
Source: https://ru.stackoverflow.com/questions/537807/
All Articles