Symfony2: problems rendering the translation-form with A2lixTranslationFormBundle and Gedmo\DoctrineExtensions Translatable

百般思念 提交于 2019-12-10 23:04:06

问题


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');

回答1:


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" 
); 


来源:https://stackoverflow.com/questions/22017382/symfony2-problems-rendering-the-translation-form-with-a2lixtranslationformbundl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!