gpt4 book ai didi

ckeditor - yii2 ckeditor 自定义插件

转载 作者:行者123 更新时间:2023-12-04 21:38:14 30 4
gpt4 key购买 nike

我正在使用 2amigos ckeditor plugins在 yii2 中,我能够从 plugin_sdk_sample 创建一个示例插件,它在原始项目中工作正常,但是当我将其放入 yii2 项目时,该按钮没有出现。

我将自定义插件放在\vendor\2amigos\yii2-ckeditor-widget\src\assets\ckeditor\plugins\中,带有 plugin.js 和 png 图标,文件夹结构如指南中所述。我认为问题在于将它添加到配置中。

我尝试在 vendor\2amigos\yii2-ckeditor-widget\src\assets\ckeditor\config.js

CKEDITOR.editorConfig = function( config ) {
config.extraPlugins = 'timestamp';
};

还尝试了以下 View :
<?= $form->field($model, 'content')->widget(CKEditor::className(), [
'clientOptions' => ['config.extraPlugins' => 'timestamp'],
'options' => ['rows' => 6],
'preset' => 'basic'
]) ?>

但它们似乎都不起作用并显示按钮,我在这里做错了什么?

最佳答案

我认为您必须将 plugin.js 添加到脚本列表中

class CKEditorAsset extends AssetBundle
{
public $js = [
'ckeditor.js',
'plugin.js',
'adapters/jquery.js'
];

关于ckeditor - yii2 ckeditor 自定义插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33006924/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com