Connecting Tinymce to Yii2

echo $form->field($model, $row['name'])->widget(TinyMce::className(), [ 'options' => ['rows' => 20], 'language' => 'ru', 'clientOptions' => [ 'plugins' => [ "advlist autolink lists link charmap print preview anchor", "searchreplace visualblocks code fullscreen", "insertdatetime media table contextmenu paste" ], 'toolbar' => "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | responsivefilemanager link image media", 'external_filemanager_path' => '/admin/plugins/responsivefilemanager/', 'filemanager_title' => 'Responsive Filemanager', 'external_plugins' => [ //Иконка/ΠΊΠ½ΠΎΠΏΠΊΠ° Π·Π°Π³Ρ€ΡƒΠ·ΠΊΠΈ Ρ„Π°ΠΉΠ»Π° Π² Π΄ΠΈΠ°Π»ΠΎΠ³Π΅ вставки изобраТСния. 'filemanager' => '/admin/plugins/responsivefilemanager/plugin.min.js', //Иконка/ΠΊΠ½ΠΎΠΏΠΊΠ° Π·Π°Π³Ρ€ΡƒΠ·ΠΊΠΈ Ρ„Π°ΠΉΠ»Π° Π² ΠΏΠ°Π½Π΅Π»Π΅ иснструмСнтов. 'responsivefilemanager' => '/admin/plugins/responsivefilemanager/tinymce/plugins/responsivefilemanager/plugin.min.js', ], ] ]); 

And although I registered the image in the toolbar, the icon is not shown in the editor. There is only one mistake in the console.

 GET http://dubno.w4u.com.ua/admin/news/edit/skin-config.html 404 (Not Found) 

Maybe because of her not working? Or what could be the problem?

    1 answer 1

    You also need to add image plugins, and if you have such a plugin, it will work.

    If not, it will issue an error to the console stating that there is no plug-in. The bottom line is that the free version of TinyMCE does not allow you to upload images, so there are a lot of different solutions to screw it, here are a couple of them:

    1. Use this extension for TinyMCE: https://github.com/PendalF89/yii2-filemanager Below there is an example connection for TinyMCE. I liked this option, so I use it.

    2. Or try this solution: http://nex-otaku-ru.blogspot.ru/2016/07/tinymce-responsive-filemanager-yii2.html

    UPD On closer inspection, it is clear that the author uses the second option, which means you may need to bring the plugins to this form and the problem will be solved:

     'plugins' => [ "advlist autolink lists link charmap hr preview pagebreak", "searchreplace wordcount textcolor visualblocks visualchars code fullscreen nonbreaking", "save insertdatetime media table contextmenu template paste image responsivefilemanager filemanager", ],