score:3

Accepted answer

Just add choice_attr

$form->add('keywords', ChoiceType::class, array(
            'choices' => $keywords,
            'label' => 'With following keywords',
            'expanded' => true,
            'multiple' => true,
            'choice_attr' => function() {
                return ['checked' => 'checked'];
            },
        ));

Related Query

More Query from same tag