$formBuilder->add('username', TextType::class, array( 'label' => 'Username', ));
$formBuilder->add('gender', ChoiceType::class, array( 'label' => 'Gender', 'choices' => array( 'Male' => 'm', 'Female' => 'f', ), ));In this example, we're adding a choice field with two options: 'Male' and 'Female'. The first parameter is the name of the field, the second parameter is the type of field we want to add (a choice field), and the third parameter is an array of options. The Symfony\Component\Form\FormInterface belongs to the Symfony Form Component library.