I am trying to render a choice field with checkboxes and I want, in edit mode, this to have the data the user previously checked meaning a way to set default data. the below code does not work. can someone help please. thank you
$days = array("monday" => "monday","tuesday" => "tuesday");
$builder->add('channels', 'choice', array(
'choices' => array(
'days' => $days,
),
'multiple' => true,
'expanded' => true,
'required' => true,
'data' => array("choices" => array("days" => array("monday")))
));