我实际上正在开发一个需要使用 Symfony 4.4 和 EasyAdmin 3 的 WYSIWYG 界面的项目。
我尝试按照此文档安装 FOS_CKEditor https://symfony.com/doc/2.x/bundles/EasyAdminBundle/integration/ivoryckeditorbundle.html以及我在 Google 或 Youtube 上找到的其他一些教程,但不幸的是我无法弄清楚为什么 CKEditorField 没有显示在我的管理仪表板上。我想我已经错过了一些东西。
一些帮助将不胜感激,这是我的配置文件:
Fos_ckeditor:
#config/packages/fos_ckeditor.yaml
twig:
form_themes:
- '@FOSCKEditor/Form/ckeditor_widget.html.twig'
fos_ck_editor:
configs:
basic_conf:
toolbar: full
易管理员:#config/packages/easy_admin.yaml
easy_admin:
design:
form_theme:
- "@EasyAdmin/form/bootstrap_4.html.twig"
- "@FOSCKEditor/Form/ckeditor_widget.html.twig"
我还尝试通过添加以下内容来定义 CrudController 中的 FieldType:#CrudController
public function configureFields(string $pageName): iterable
{
return [
..//
TextareaField::new('corps', 'Corps')
->setFormType(CKEditorType::class),
但它没有奏效。预先感谢您的帮助!
最佳答案
根据 https://github.com/EasyCorp/EasyAdminBundle/issues/3412
你可以加
public function configureCrud(Crud $crud): Crud
{
return $crud
->addFormTheme('@FOSCKEditor/Form/ckeditor_widget.html.twig')
;
}
它对我来说很好:)
关于symfony - CKEditor 不能在 Symfony 4.4 上使用 EasyAdmin 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63199861/