title: Symfony2 grouped form items
body: <p>I really need your help creating a form. I have <strong>entity</strong> with <code>$id</code>, <code>$name</code> and <code>$items</code> properties. <code>$items</code> is manyToMany relation. Then I have two other entities <strong>group</strong> and <strong>item</strong>. Both have <code>$id</code> and <code>$name</code> properties. <strong>group</strong> and <strong>entity</strong> have relation to <strong>item</strong>. Something like this:</p>
  
  <pre>
  Group 1                 Entity 1
   |- Item 1               |- Item 1
   '- Item 2               |- Item 2
                           '- Item 3
  
  Group 2                 Entity 2
   |- Item 3               |- Item 2
   '- Item 4               |- Item 3
                           '- Item 4
  </pre>
  
  <p>What's the best way to create a form for <strong>entity</strong> with grouped items? Like this:</p>
  
  <pre>
  ----------------------------------------------------
  Group 1
   ☑ Item 1              ☑ Item 2
  ----------------------------------------------------
  Group 2
   ☑ Item 3              ☑ Item 4
  </pre>
  
  <p>Tried to google, but, to be honest, I've no idea where to start :/</p>