jeudi 21 avril 2016

Multiple checkboxes with select all check box in symfony form builder

I need a select All check box with this multiple check boxes. If i click that select all check box, all the check boxes should be selected. and deselect also i need.

class HabitacionFotoPrincipalType extends AbstractType {

public function buildForm(FormBuilder $builder, array $options) {
    $builder->add('choice', 'choice', array(



        'choices'   => array(
            'morning'   => 'Morning',
            'afternoon' => 'Afternoon',
            'evening'   => 'Evening',
        ),


        'expanded' => true,
        'multiple'  => true,
    ))

}

}




Aucun commentaire:

Enregistrer un commentaire