Symfony2:使用A2lixTranslationFormBundle和Gedmo \DoctrineExtensions呈现翻译形式的问题可翻译 [英] Symfony2: problems rendering the translation-form with A2lixTranslationFormBundle and Gedmo\DoctrineExtensions Translatable

查看:153
本文介绍了Symfony2:使用A2lixTranslationFormBundle和Gedmo \DoctrineExtensions呈现翻译形式的问题可翻译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 gedmo / doctrine-translations a2lix / translation-form-b​​undle:2。* @ dev 翻译我的实体。



翻译形式始终呈现 Field Content ,但我的实体本身doesn不包含字段内容字段。

表单类型 p>

  $ builder-> add('translations','a2lix_translations'); 


解决方案

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



查看包的 升级说明



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






解决方案:

要么更新 gedmo / doctrine-extensions ...

  composer require gedmo /doctrine-extensions:wip-v2.4.0@dev 
作曲家更新gedmo / doctrine-extensions



<

 作曲家要求a2lix / translation-form-b​​undle:〜1.2 
作曲家更新a2lix / translation-form-b​​un dle






c $ c> 1.x 版本的a2lix / TranslationFormBundle:



您需要使用 a2lix_translations_gedmo 字段类型,如文档

进一步,您需要在options-array中指定可转换的类,如下所示:

'translatable_class'=> 你的实体
);


I'm using gedmo/doctrine-translations and a2lix/translation-form-bundle: 2.*@dev to translate my entities.

The translation form always renders a Field and Content but my entity itself doesn't contain a Field or Content field.

The form type

$builder->add('translations', 'a2lix_translations');

解决方案

The 2.0 version of the TranslationFormBundle isn't compatible with the current gedmo/doctrine-extensions version.

See the bundle's upgrade notes.

You'll need to use the currently unstable branches wip-v2.4.0 and .


solution:

Either update gedmo/doctrine-extensions ...

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

... or downgrade your a2lix/translation-form-bundle version:

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


important notice for the 1.x version of a2lix/TranslationFormBundle:

You need to use the a2lix_translations_gedmo field-type as described in the documentation.

Further you need to specify the translatable class in the options-array like this:

$builder->add('translations', 'a2lix_translations_gedmo', array( 
    'translatable_class' => "Your\Entity" 
); 

这篇关于Symfony2:使用A2lixTranslationFormBundle和Gedmo \DoctrineExtensions呈现翻译形式的问题可翻译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆