@param FormBuilderInterface $builder
@param array $options

@return FormBuilderInterface
501621
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('id', 'hidden')
            ->add('typeOfSchoolAttendanceAtFourteen', 'choice',
                array(
                    'placeholder' => 'form.select',
                    'label'       => 'socioEconomic.form.typeOfSchoolAttendanceAtFourteen.label',
                    'choices'     => array(
                        'A state run or funded school that did not select pupils on the basis of academic ability (e.g. a comprehensive, secondary modern, Scottish High School/Secondary School/Academy)' => 'A state run or funded school that did not select pupils on the basis of academic ability (e.g. a comprehensive, secondary modern, Scottish High School/Secondary School/Academy)',
                        'A state run or funded school that selected on the basis of academic ability'                                                                                                      => 'A state run or funded school that selected on the basis of academic ability',
                        'An independent school, but your fees were paid in part or full by the local authority (sometimes called a ‘direct grant’ school or an ‘assisted place’)'                          => 'An independent school, but your fees were paid in part or full by the local authority (sometimes called a ‘direct grant’ school or an ‘assisted place’)',
                        'An independent school, but your fees were paid in part or full by a bursary or scholarship'                                                                                       => 'An independent school, but your fees were paid in part or full by a bursary or scholarship',
                        'An independent school, and your fees were not paid in part by the local authority or bursary/scholarship'                                                                         => 'An independent school, and your fees were not paid in part by the local authority or bursary/scholarship',
                        'A school outside the UK education system'                                                                                                                                         => 'A school outside the UK education system',
                        'Prefer not to say'                                                                                                                                                                => 'Prefer not to say',
                    )
                )
            )
            ->add('firstPersonInImmediateFamilyToAttendUniversity', 'choice',
                array(
                    'placeholder' => 'form.select',
                    'label'       => 'socioEconomic.form.firstPersonInImmediateFamilyToAttendUniversity.label',
                    'choices'     => array(
                        'Yes'               => 'Yes',
                        'No'                => 'No',
                        'Don\'t Know'       => 'Don\'t Know',
                        'Prefer Not to Say' => 'Prefer Not to Say',
                    )
                )
            )
            ->add('eligibleForFreeSchoolMeals', 'choice',
                array(
                    'placeholder' => 'form.select',
                    'label'       => 'socioEconomic.form.eligibleForFreeSchoolMeals.label',
                    'choices'     => array(
                        'Yes'               => 'Yes',
                        'No'                => 'No',
                        'Don\'t Know'       => 'Don\'t Know',
                        'Prefer Not to Say' => 'Prefer Not to Say',
                    )
                )
            )
            ->add('everSpentMoreThanThreeMonthsInCare', 'choice',
                array(
                    'placeholder' => 'form.select',
                    'label'       => 'socioEconomic.form.everSpentMoreThanThreeMonthsInCare.label',
                    'choices'     => array(
                        'Yes'               => 'Yes',
                        'No'                => 'No',
                        'Don\'t Know'       => 'Don\'t Know',
                        'Prefer Not to Say' => 'Prefer Not to Say',
                    )
                )
            )
            ->add('everPersonallyHadRefugeeOrAsylumStatus', 'choice',
                array(
                    'placeholder' => 'form.select',
                    'label'       => 'socioEconomic.form.everPersonallyHadRefugeeOrAsylumStatus.label',
                    'choices'     => array(
                        'Yes'               => 'Yes',
                        'No'                => 'No',
                        'Don\'t Know'       => 'Don\'t Know',
                        'Prefer Not to Say' => 'Prefer Not to Say',
                    )
                )
            );

        return $builder;
    }
287771
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('pageName', null, array(
            'label' => 'pages_controller_label_page_name',
        ));
        $builder->add('template', 'choice', array(
            'choices' => ChoiceValues::getTemplates($this->activeTheme, $this->themes),
            'label' => 'pages_controller_label_template',
        ));
        $builder->add('isHome', 'checkbox', array(
            'label' => 'pages_controller_label_home_page',
            'attr' => array(
                'title' => 'pages_controller_home_page_explanation',
            ),
        ));
        $builder->add('isPublished', 'checkbox', array(
            'label' => 'pages_controller_label_published',
        ));
    }
827065
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        /**
         * @var Plugin $plugin
         */
        $plugin = $options['plugin'];
        foreach ($plugin->getFields() as $fieldName => $field) {
            $builder
                ->remove($fieldName)
                ->add($fieldName, $field['type'], array_merge([
                    'label' => $field['label'],
                    'data' => $field['data'],
                    'required' => $field['required'],
                    'attr' => $field['attr'],
                ], $field['options']), $field);
        }

        $builder->add('save', 'submit');
    }
10281
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        if (!$options['data'] || null === $options['data']->getId()) {
            $options['provider']->buildCreateForm($builder, $options);
        } else {
            $options['provider']->buildEditForm($builder, $options);
        }

        $builder->add('provider', HiddenType::class, ['data' => $options['provider']->getName()]);
    }
870683
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add($builder
                ->create('tree', HiddenType::class, array(
                    'attr' => array(
                        'class' => 'synapse-tree-menu',
                        'data-labels' => json_encode(array(
                            'link' => array(
                                'name' => 'Name',
                                'url' => 'Url',
                            ),
                        )),
                    ),
                ))
                ->addModelTransformer($this)
            )
        ;
    }
1129775
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $this->entityProxyFieldsBuilder->buildForEntityAndWidgetType($builder, $options['widget'], $options['namespace']);
    }
94788
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->addModelTransformer($this)
            ->add('name', TextType::class)
            ->add('title', TextType::class)
            ->add('path', TextType::class, array(
                'required' => false,
            ))
            ->add('parent', ChoiceType::class, array(
                'required' => true,
                'choices' => $this->pageLoader->retrieveAll(),
                'choice_label' => function (Page $page) {
                    return sprintf('%s (/%s)', $page->getName(), $page->getPath());
                },
            ))
            ->add('submit', SubmitType::class)
        ;
    }
280585
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        if (!$options['csrf_protection']) {
            return;
        }

        $builder
            ->addEventSubscriber(new CsrfValidationListener(
                $options['csrf_field_name'],
                $options['csrf_token_manager'],
                $options['csrf_token_id'] ?: ($builder->getName() ?: \get_class($builder->getType()->getInnerType())),
                $options['csrf_message'],
                $this->translator,
                $this->translationDomain,
                $this->serverParams
            ))
        ;
    }
141763
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $templateType = $options['template_type'];
        $variation = $options['variation'];

        $builder
            ->addModelTransformer($this)

            // build template zones
            ->add('zones', CollectionType::class, array(
                'allow_add' => false,
                'allow_delete' => false,
                'entry_type' => ZoneType::class,
                'entry_options' => array(
                    'theme' => $options['theme'],
                    'content_type' => $options['content_type'],
                    'template_type' => $options['template_type'],
                ),
            ))

            // zone type selection (unmapped, frontend use case - should be defined in Twig layout ?)
            ->add('zone_types', ChoiceType::class, array(
                'mapped' => false,
                'required' => true,
                'expanded' => false,
                'choices' => $templateType->getZoneTypes()->indexBy('name'),
                'choice_value' => 'name',
                'choice_label' => 'name',

                // main zone by default
                'data' => $templateType->getZoneTypes()
                    ->filter(function (ZoneTypeInterface $zoneType) use ($variation) {
                        return $variation->getConfiguration(
                            'zones', $zoneType->getName(), 'main', false
                        );
                    })
                    ->first() ?: null,
            ))
        ;
    }
1225429
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        parent::buildForm($builder, $options);
        $builder->get('value')->addModelTransformer(new StringToDateTimeTransformer('1'));
    }
908413
public function buildForm(FormBuilderInterface &$builder, array $options, array $data)
    {
        $this->addStandardFormFields('contactsource', 'categories', $builder, $data);
        $this->addExtendedFormFields('contactsource', 'items', $builder, $data);
        //This is in anticipation of PR 5995 getting merged ~2.16
        if (method_exists($this, 'addCustomFormFields')) {
            $addCustomFormFields = 'addCustomFormFields';
            $this->$addCustomFormFields($this->getName(), 'export', $builder, 'mautic.core.permissions.export', ['disable' => 'mautic.core.permissions.disable'], $data);
        }
    }
104750
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('expression', TextType::class, [
                'required' => true,
                'constraints' => [new ExpressionConstraint()],
            ])
            ->add('arguments', TextType::class, [
                'required' => false,
                'constraints' => [new ArgumentsConstraint()],
            ])
            ->add('priority', IntegerType::class, [
                'required' => true,
            ])
            ->add('enabled', CheckboxType::class, [
                'required' => false,
            ])
            ->add('update', SubmitType::class, [
                'label' => /** @Desc("Update") */
                    'cron_update_form.update',
            ]);
    }
493382
public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        // Get the context and membership provider to pass into transformer.
        $context = $this->production_context;
        $provider = $this->membership_provider;

        $builder
            ->add('optional', null, [
                'label' => 'invitation.form.optional',
            ])
            ->add('invitee', ChoiceType::class, [
                'label' => 'invitation.form.invitee',
                'placeholder' => 'invitation.form.choose_invitee',
                'choice_translation_domain' => false,

                // Load all active memberships for a production as choices.
                'choice_loader' => new CallbackChoiceLoader(function () use ($context, $provider) {
                    foreach ($provider->loadActiveMembershipsByProduction($context->getContext()) as $membership) {
                        $member = $membership->getMember();
                        yield $member->__toString() => $member->getUsername();
                    }
                }),
            ])
        ;
    }
610578
public function buildForm(FormBuilderInterface $builder, array $options)
	{
		$builder->add('name', TextType::class, array(
			'label' => 'Config name',
			'required' => true
		))
		->add('alias', TextType::class, array(
			'label' => 'Alias (interal use)',
			'required' => true 
		))
		->add('parameters', BaseCollectionType::class, array(
			'entry_type' => ParameterType::class,
			'label' => 'List of parameters',
			'allow_add' => true,
			'allow_delete' => true,
			'prototype' => true,
			'containerId' => 'parameters-collection'
		))
		->add('isDefault', CheckboxType::class, array(
			'label' => 'Configuration par défaut'
		));
	}
1342419
public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add(
                self::START_NAME,
                DateType::class,
                [
                    'widget' => 'single_text',
                    'attr' => [
                        'placeholder' => 'sidus.filter.date_range.start_date',
                    ],
                ]
            )
            ->add(
                self::END_NAME,
                DateType::class,
                [
                    'widget' => 'single_text',
                    'attr' => [
                        'placeholder' => 'sidus.filter.date_range.end_date',
                    ],
                ]
            );
    }
244458
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add(
            '__tab_main',
            TabType::class,
            [
                'label' => 'admin.user.tab.main.label',
                'inherit_data' => true,
            ]
        );
        /** @var FormBuilderInterface $mainTab */
        $mainTab = $builder->get('__tab_main');
        $mainTab
            ->add(
                'username',
                TextType::class,
                [
                    'label' => 'admin.user.form.username.label',
                ]
            )
            ->add(
                'email',
                EmailType::class,
                [
                    'label' => 'admin.user.form.email.label',
                ]
            );

        if ($this->getUser() && $this->authorizationChecker->isGranted('ROLE_ADMIN', $this->getUser())) {
            $mainTab
                ->add(
                    'enabled',
                    SwitchType::class,
                    [
                        'label' => 'admin.user.form.enabled.label',
                    ]
                )
                ->add(
                    'rawRoles',
                    RoleHierarchyType::class,
                    [
                        'label' => 'admin.user.form.roles.label',
                    ]
                )
                ->add(
                    'familyPermissions',
                    BootstrapCollectionType::class,
                    [
                        'label' => 'admin.user.form.familyPermissions.label',
                        'entry_type' => FamilyPermissionType::class,
                        'entry_options' => [],
                        'allow_add' => true,
                        'allow_delete' => true,
                        'required' => false,
                        'sortable' => false,
                        'by_reference' => false,
                    ]
                );

            $builder->add(
                '__tab_groups',
                TabType::class,
                [
                    'label' => 'admin.user.tab.groups.label',
                    'inherit_data' => true,
                ]
            );
            /** @var FormBuilderInterface $groupsTab */
            $groupsTab = $builder->get('__tab_groups');
            $groupsTab
                ->add(
                    'groups',
                    EntityType::class,
                    [
                        'label' => 'admin.user.form.groups.label',
                        'class' => Group::class,
                        'expanded' => true,
                        'multiple' => true,
                    ]
                );
        }

        $builder->add(
            '__tab_info',
            TabType::class,
            [
                'label' => 'admin.user.tab.info.label',
                'inherit_data' => true,
            ]
        );
        // Add EAV data edition
        $this->buildDataForm($builder);

        $builder->addEventListener(
            FormEvents::POST_SUBMIT,
            function (FormEvent $event) {
                /** @var User $user */
                $user = $event->getData();
                if ($user) {
                    $user->setUpdatedAt(new \DateTime());
                }
            }
        );
    }
1050186
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $tags = $this->filterQueryHandler->handle($options['widget'], Tag::class);

        foreach ($tags as $tag) {
            $tagsChoices[$tag->getTitle()] = $tag->getId();
        }

        $data = null;
        if ($this->getRequest()->query->has('filter') && array_key_exists('tag_filter', $this->getRequest()->query->get('filter'))) {
            if ($options['multiple']) {
                $data = [];
                foreach ($this->getRequest()->query->get('filter')['tag_filter']['tags'] as $id => $selectedTag) {
                    $data[$id] = $selectedTag;
                }
            } else {
                $data = $this->getRequest()->query->get('filter')['tag_filter']['tags'];
            }
        }

        $builder
            ->add('tags', ChoiceType::class, [
                'label'             => false,
                'choices'           => $tagsChoices,
                'choices_as_values' => true,
                'placeholder'       => 'blog.tag_filter.empty_value',
                'required'          => false,
                'expanded'          => true,
                'multiple'          => $options['multiple'],
                'data'              => $data,
            ]);
    }