It seems that Symfony2 Form component does not handle this common case. Below is what I want in my html

The code looks like :
->add('code', 'choice', array(
'choices' => array(
'Food' => array('pizza', 'burger', 'icecream'),
'Music' => array('poney', 'little', 'pocket'),
),
'multiple' => true,
'expanded' => true,
'required' => true
));
Which gives in reality the wrong output :

It’s wierd because the case with expanded => false is correctly handled

How to handle that case please ?
Ok so here’s the form_theme solution for this
Of course the extra js layer is missing, but you get the idea.