Closed GAMITG closed 7 years ago
Download the plugin and add it to a web folder, then register a script AFTER rendering the widget:
$this->registerJs("CKEDITOR.plugins.addExternal(....)");
use any of the following options (from documentation)
// Loads a plugin from '/myplugin/samples/plugin.js'.
CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/' );
// Loads a plugin from '/myplugin/samples/my_plugin.js'.
CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/', 'my_plugin.js' );
// Loads a plugin from '/myplugin/samples/my_plugin.js'.
CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/my_plugin.js', '' );
Thank you. @tonydspaniard
I cannot configure CkEditor with wordcount :( Any help please?
This is the solution I found:
in the forms's view:
<?php echo $form->field($model, 'description')->widget(CKEditor::className(), [
'options' => ['rows' => 6],
'preset' => 'full',
'clientOptions' => [
'extraPlugins' => 'widgetbootstrap',
]
]) ?>
<?php
$this->registerJs("CKEDITOR.plugins.addExternal('widgetbootstrap', '/js/widgetbootstrap/', 'plugin.js');");
And the plugin's folder I've copied to @app/web/js
E.g. web/js/widgetbootstrap/plugin.js
I'm glad that my solution helped!
I need to add
wordcount
plugin in CKeditor. please give me solution for this.