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