php - Translate empty value in Symfony form -
i have form select box, , field has empty value property. want have translated adding translation_domain doesn't change anything.
<?php namespace devell\howfolderbundle\form; use symfony\component\form\abstracttype; use symfony\component\form\formbuilderinterface; class notetype extends abstracttype { public function buildform(formbuilderinterface $builder, array $options) { $builder ->add('name', 'text') ->add('body', 'textarea'); $categorychoices = array(); $builder->add('category', 'entity', array( 'class' => 'howfolderbundle:category', 'empty_value' => 'note.form.category.choose', 'translation_domain' => 'howfolderbundle' )); } public function getname() { return "note"; } }
this should perfectely work it's natively supported since > [form] made possible translate empty value of choice fields.
then problem related translation configuration, check if translation component enabled , configured.
Comments
Post a Comment