IvoryCKEditorBundle:如何自定义工具栏项?
IvoryCKEditorBundle: how to customize toolbar items?
我需要自定义 Symfony bundle IvoryCKEditorBundle 工具栏的项目。
我知道可以通过在 this way 中添加项目来自定义工具栏,但我如何编辑项目本身或创建自定义项目?
CKEditor 文档对此进行了解释 here,但我不确定如何使用 Symfony IvoryCKEditor 包来做同样的事情。
一种优雅的方式可能是首先 creating a CKEditor plugin, and then loading the plugin into the IvoryCKEditorBundle:
# app/config/config.yml
ivory_ck_editor:
default_config: my_config
configs:
my_config:
extraPlugins: "mycustomplugin"
plugins:
mycustomplugin:
path: "/bundles/mybundle/mycustomplugin/"
filename: "plugin.js"
插件文件夹(在我的例子中 mycustomplugin
)应该放在包源的 Resources/public
文件夹下(例如 src/MyBundleName/Resources/pubic
)。
编辑:另外,请注意,如果您需要安装多个插件,则 extraPlugins 列表应以逗号 分隔,而无需 space,例如:
extraPlugins: "mycustomplugin1,mycustomplugin2,mycustomplugin3"
我需要自定义 Symfony bundle IvoryCKEditorBundle 工具栏的项目。
我知道可以通过在 this way 中添加项目来自定义工具栏,但我如何编辑项目本身或创建自定义项目?
CKEditor 文档对此进行了解释 here,但我不确定如何使用 Symfony IvoryCKEditor 包来做同样的事情。
一种优雅的方式可能是首先 creating a CKEditor plugin, and then loading the plugin into the IvoryCKEditorBundle:
# app/config/config.yml
ivory_ck_editor:
default_config: my_config
configs:
my_config:
extraPlugins: "mycustomplugin"
plugins:
mycustomplugin:
path: "/bundles/mybundle/mycustomplugin/"
filename: "plugin.js"
插件文件夹(在我的例子中 mycustomplugin
)应该放在包源的 Resources/public
文件夹下(例如 src/MyBundleName/Resources/pubic
)。
编辑:另外,请注意,如果您需要安装多个插件,则 extraPlugins 列表应以逗号 分隔,而无需 space,例如:
extraPlugins: "mycustomplugin1,mycustomplugin2,mycustomplugin3"