title: Symfony: choice_list with pre-selected values
body: <p>I have an array field in my Entity called <strong>Type</strong> and I want to restrict the value that the user can specify for the field as this:</p>
  
  <pre><code>Type1      [] subtitle1        [] subtitle2         [] subtitle3
  
  Type2      [] subtitle1        [] subtitle2         [] subtitle3
  </code></pre>
  
  <p>I managed to do this by creating <code>choice</code> form type and a little twig customization like this:</p>
  
  <pre><code>$form = $this-&gt;createFormBuilder($entity)
                  -&gt;add('name', 'text')
                  -&gt;add('type', 'choice', array(
                      'multiple' =&gt; true,
                      'choice_list' =&gt; new myBundle\Form\Extension\CustomChoiceList($param1,$param2),
                      'label' =&gt; 'my Label',
                      'expanded' =&gt; true
                  ));// CustomChoiceList extends ChoiceList
  </code></pre>
  
  <p>my issue now is when i have an entity i want to edit, how can i show the user the same form but with some of the checkboxes checked?</p>
  
  <p>I checked <code>ChoiceList</code> and it's creating the checkboxes by using <code>ChoiceView</code> class which has no <code>checked</code> option only <code>label</code>, <code>value</code>, <code>data</code></p>
  
  <p>Thanks </p>