如何在Sonata Admin中使用CK编辑器html

问题描述

解决方

1-安装ckeditor-bundle dehu-composer需要Friendsofsymfony / ckeditor-bundle

2-安装资产

  • docker-compose exec -u www-data dehu-PHP bin / console ckeditor:install(已安装)

  • docker-compose exec -u www-data dehu-PHP bin /控制台资产:安装

3-创建一个名为fos_ckeditor.yaml的配置文件

fos_ckeditor.yaml

twig:
form_themes:

'@FOSCKEditor/Form/ckeditor_widget.html.twig'
fos_ck_editor:
default_config: default
configs:
default:

default toolbar plus Format button
toolbar:
[Bold,Italic,Underline,-,Cut,copy,Paste,PasteText,PasteFromWord,Undo,Redo,NumberedList,BulletedList,Outdent,Indent,Blockquote,Image,Link,Unlink,Table]
[Format,Maximize,Source]

4-用于在类型中使用此标志CKEditorType :: class,例如:

->add('message',CKEditorType::class,['label' => 'Message'])

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)