交响乐2:使用 A2lixTranslationFormBundle 和 Gedmo\DoctrineExtensions Translatable 渲染翻译形式时出现问题

StackOverflow https://stackoverflow.com//questions/22017382

我在用着 gedmo/doctrine-translationsa2lix/translation-form-bundle: 2.*@dev 翻译我的实体。

翻译形式总是呈现 场地内容 但我的实体本身不包含 场地 或者 内容 场地。

表格类型

$builder->add('translations', 'a2lix_translations');
有帮助吗?

解决方案

2.0 TranslationFormBundle 的版本 不兼容 与当前的 gedmo/doctrine-extensions 版本。

查看捆绑包的 升级注意事项.

您需要使用当前不稳定的分支 wip-v2.4.0 和 。


解决方案:

任何一个 更新 gedmo/学说扩展 ...

composer require gedmo/doctrine-extensions:wip-v2.4.0@dev
composer update gedmo/doctrine-extensions

...或者 降级 你的 a2lix/translation-form-b​​undle 版本:

composer require a2lix/translation-form-bundle:~1.2
composer update a2lix/translation-form-bundle

重要通知 1.x a2lix/TranslationFormBundle 版本:

您需要使用 a2lix_translations_gedmo 字段类型,如中所述 文档.

此外,您需要在选项数组中指定可翻译类,如下所示:

$builder->add('translations', 'a2lix_translations_gedmo', array( 
    'translatable_class' => "Your\Entity" 
); 
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top