Answers for "Symfony :How to add selected choice with a object ?"

1

choice type symfony

use SymfonyComponentFormExtensionCoreTypeChoiceType;
// ...

$builder->add('isAttending', ChoiceType::class, [
    'choices'  => [
        'Maybe' => null,
        'Yes' => true,
        'No' => false,
    ],
]);
Posted by: Guest on September-18-2020

Code answers related to "Symfony :How to add selected choice with a object ?"

Browse Popular Code Answers by Language