jeudi 9 avril 2015

Simple Form with doctrine knp translatable extentions

I'm searching for a simple way to edit translated fields within a symfony2 form. I'm using the doctrine knp translatable extentions for translation of the entity. The form mixes not translated with translated properties in a special order. The form should be displayed (end edit) only in the active language. For example:



$builder
->add('key')
->add('translate1','text',array(
'property_path' => 'translations[de].translate1',
))
->add('mynumber')
->add('translate2','text',array(
'property_path' => 'translations[de].translate2',
))


If the language translations[de] does not exists i get an error: "Cannot read property "translate1" from an array... "


A2LiX Translation Form is not the solution, because it displays all translatabe fields in a single list.


Any ideas?


Aucun commentaire:

Enregistrer un commentaire