I have a simpleform:
public function buildForm(FormBuilderInterface $builder, array $option){
$builder
->setMethod('POST')
->add('isdigital', 'choice', array(
'choices' => array('0' => 'no', '1' => 'yes'),
'expanded' => true,
'multiple' => false,
'data'=> 0
));
}
I populate this form passing in an array key value, without using doctrine entities.
$this->createForm(new PricingType(), $defaultData);
The attribute 'data' should set the value only for the first time, instead overrides the value passed with the array.
If I remove the 'data' attribute, the radio button actually displays the value passed in the array.
Is there any way I can set the default value only for the first time?