I want to display checkboxes from a pre-defined array in my Symfony form. User should be able to select more than one but I am not able to do it.

This is my code:

public function buildForm(FormBuilder $builder, array $options)
{
    $roles = array('role1', 'role2', 'role3');
    $builder
        ->add('name')
        ->add('roles', 'checkbox', $roles)
    ;
}
Edit
Report