I would like to know if there is a way to set the value of a parameter in a select list. This selection is a selection field.
Everything works fine in my code. The thing is, in my opinion, I got the identifier of each field in the value option, and I need to have another field.
I use the option property to indicate what will be shown in the parameter name, but I need to also set what will be displayed in the value field.
I have not managed to find a solution so far, so if someone can help me, he will be very appreciated.
A small part of my field is in the form type.
->add('fieldName','entity', array(
'class' => 'path\to\entity',
'property' => 'name',
'multiple' => true,
'expanded' => false,
)
Thank.
My returned HTML is as follows
<select>
<option value="4">ROLE_EXAMPLE</option>
</select>
What I'm trying to do is get this result:
<select>
<option value="specific_property_from_entity">ROLE_EXAMPLE</option>
</select>