Symfony 2 value on Enitty field

48 views Asked by At

I made a form with Symfony 2, my problem is that the entity fields doesn't show the value from the database, the other fields on the form are compiled well and the data I pass to the form contains the right value.

The code in form type is:

->add('nazione', 'entity', array(
                'class' => 'CRIPatentiBundle:Nazioni',
                'property' => 'nomeEsteso',
                )
             )

the twig code is:

{{ form_widget(form.nazione) }}

the dump of the array shows the right value in the database

-nazione: 102

But the select in html shows the first value, not the one is specified and the value property of the select item is 102

0

There are 0 answers