I'm using 2amigos ckeditor plugins in yii2, I was able to create a sample plugins from plugin_sdk_sample, it works fine in a raw project, but when I put that in a yii2 project, the button doesn't appear.
I put the custom plugin in \vendor\2amigos\yii2-ckeditor-widget\src\assets\ckeditor\plugins\ with plugin.js and png icon with the folder structure as described in the guide. I think the problem is with adding it to config.
I tried following in vendor\2amigos\yii2-ckeditor-widget\src\assets\ckeditor\config.js
CKEDITOR.editorConfig = function( config ) {
config.extraPlugins = 'timestamp';
};
also tried the following in view:
<?= $form->field($model, 'content')->widget(CKEditor::className(), [
'clientOptions' => ['config.extraPlugins' => 'timestamp'],
'options' => ['rows' => 6],
'preset' => 'basic'
]) ?>
but none of them seems to work and showing the button, what am I doing wrong here?
I think you have to add plugin.js into the list of script in
class CKEditorAsset extends AssetBundle
{
public $js = [
'ckeditor.js',
'plugin.js',
'adapters/jquery.js'
];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With