【问题标题】:How to use the text editor type for a translated type with EasyAdmin 2 and A2lix TranslationFormBundle如何使用 EasyAdmin 2 和 A2lix TranslationFormBundle 将文本编辑器类型用于翻译类型
【发布时间】:2021-12-21 04:21:01
【问题描述】:

在下面的示例中,SetTranslation 实体有一个字段 introduction (type="text"),它使用简单的文本区域显示在表单中。

如何配置文本字段以使用带有翻译字段的 text_editor(仅 EasyAdmin 知道)?

这是 Set 实体的 EasyAdmin 2 配置:

easy_admin:
    entities:
        Set:
            form:
                fields:
                    - 
                        property: translations
                        type: 'A2lix\TranslationFormBundle\Form\Type\TranslationsType'

【问题讨论】:

    标签: easyadmin a2lix-translation


    【解决方案1】:

    解决方案是使用type_optionsfield_type 属性指定具有完整路径的类型:

    easy_admin:
        entities:
            Set:
                form:
                    fields:
                        - 
                            property: translations
                            label: ''
                            type: 'A2lix\TranslationFormBundle\Form\Type\TranslationsType'
                            type_options: 
                                fields:
                                    introduction: 
                                        field_type: 'EasyCorp\Bundle\EasyAdminBundle\Form\Type\TextEditorType'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-04-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-01
      • 2011-09-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多