Add field's options

@param Form|FormBuilderInterface $builder

@return void
18199
public function addFieldOptions($builder)
    {
        $builder->get('options')
            ->add('width', NumberType::class, ['required' => false])
            ->add('height', NumberType::class, ['required' => false])
        ;
    }
57964
protected function addDraft(Builder $builder): void
    {
        $builder->macro('draft', function (Builder $builder) {
            return $builder->update(['is_drafted' => 1]);
        });
    }
316109
public function addBuilder(BuilderInterface $builder)
    {
        parent::addBuilder($builder);

        $builder->setVariables(
            $this->mergeParameters(
                $this->getFromYaml('params', array()),
                $this->getFromYaml(sprintf('builders.%s.params', $builder->getYamlKey()), array())
            )
        );
        $builder->setColumnClass($this->getColumnClass());
    }
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)
        ;
    }
1225429
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        parent::buildForm($builder, $options);
        $builder->get('value')->addModelTransformer(new StringToDateTimeTransformer('1'));
    }
295834
public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('start', null, [
                'label' => 'event.form.start',
                'date_widget' => 'single_text',
                'time_widget' => 'single_text',
            ])
            ->add('end', null, [
                'label' => 'event.form.end',
                'date_widget' => 'single_text',
                'time_widget' => 'single_text',
            ])
            ->add('name', null, [
                'label' => 'event.form.name',
            ])
            ->add('description', CKEditorType::class, [
                'label' => 'event.form.description',
                'required' => false,
                'config' => ['toolbar' => 'basic'],
            ])
            ->add('full_company', CheckboxType::class, [
                'label' => 'event.form.full_company',
                'required' => false,
            ])
            ->add('invitations', CollectionType::class, [
                'label' => 'event.form.invitations',
                'entry_type' => InvitationType::class,
                'entry_options' => ['label' => false],
                'allow_add' => true,
                'allow_delete' => true,
                'by_reference' => false,
            ])
        ;
    }
338167
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        parent::buildForm($builder, $options);
        $builder->add('title', null, [
                'label'    => 'widget_richlist.form.title.label',
                'required' => true,
            ])
            ->add('description', TextareaType::class, [
                'label'    => 'widget_richlist.form.description.label',
                'required' => true,
            ])
            ->add('kind', null, [
                'label'    => 'widget_richlist.form.kind.label',
                'required' => true,
            ])
            ->add('image', MediaType::class, [
                'label'    => 'widget_richlist.form.image.label',
                'required' => false, ])
            ->add('image2', MediaType::class, [
                'label'    => 'widget_richlist.form.image2.label',
                'required' => false, ])
            ->add('link', LinkType::class)
            ->add('linkLabel', null, [
                'label'    => 'form.widget_richlist.linkLabel.label',
                'required' => false,
            ])
            ->add('linkEnabled', CheckboxType::class, [
                    'label'    => 'form.widget_richlist.linkEnabled.label',
                    'required' => false,
                    'attr'     => [
                        'onchange' => 'linkEnable($vic(this).is(\':checked\']);',
                    ],
            ]);
    }
338887
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        if ($options['add_author']) {
            $builder->add('authorName', TextType::class, ['required' => true]);

            $this->vars['add_author'] = $options['add_author'];
        }

        if ($options['show_note']) {
            $builder->add('note', ChoiceType::class, [
                'required' => false,
                'choices' => $this->noteProvider->getValues(),
            ]);
        }

        $builder
            ->add('website', UrlType::class, ['required' => false])
            ->add('email', EmailType::class, ['required' => false])
        ;
    }
193985
protected function addBankAccount(FormBuilderInterface $builder)
    {
        $builder->add(
            static::FIELD_BANK_ACCOUNT,
            TextType::class,
            [
                'label' => false,
                'required' => true,
                'constraints' => [
                ],
            ]
        );

        return $this;
    }
43883
protected function addPlainPasswordField(FormBuilderInterface $builder, array $options)
    {
        return $builder->add('plainPassword', 'repeated', array(
                    'type' => 'password',
                    'options' => array('translation_domain' => 'FOSUserBundle'),
                    'first_options' => array(
                        'label' => 'form.password',
                        'attr' => array(
                            'help_text' => $this->translator->trans('open_orchestra_user.form.registration_user.complex_user_password', array(), 'validators'),
                        ),
                    ),
                    'second_options' => array('label' => 'form.new_password_confirmation'),
                    'invalid_message' => 'fos_user.password.mismatch',
                    'group_id' => 'authentication',
                    'sub_group_id' => 'identifier',
                    'required' => $options['required_password'],
                )
            );
    }
1317140
protected function addHiddenInputs(FormBuilderInterface $builder)
    {
        parent::addHiddenInputs($builder);

        $builder->add(
            self::FIELD_PSEUDO_CARD_NUMBER,
            HiddenType::class,
            [
                'label' => false,
            ]
        );

        return $this;
    }
484995
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $this->addOnlineBankTransferType($builder, $options)
            ->addBankCountry($builder, $options);
    }
1015658
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        parent::buildForm($builder, $options);

        $builder->add('layout', ChoiceType::class, [
            'label'   => 'form.template.type.layout.label',
            'choices' => array_flip($options['layouts']),
        ]);

        $builder->add('translations', TranslationsType::class, [
            'fields' => [
                'name' => [
                    'label' => 'form.view.type.name.label',
                ],
            ],
        ]);

        $builder->remove('roles');
    }
1110489
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $new      = !empty($options['data']) && $options['data']->getAlias() ? false : true;

        // change default option to "extendedField" from "lead" when plugin is enabled and config set
        $disallowLead = $this->coreParameters->getParameter('disable_lead_table_fields', false);
        if ($disallowLead && $new) {
            $options['data']->setObject('extendedField');
        }
        $disabled = !empty($options['data']) ? $options['data']->isFixed() : false;

        $builder->add(
            'object',
            'choice',
            [
                'choices'           => [
                    'mautic.lead.contact'             => 'lead',
                    'mautic.company.company'          => 'company',
                    'mautic.lead.extendedField'       => 'extendedField',
                    'mautic.lead.extendedFieldSecure' => 'extendedFieldSecure',
                ],
                'choices_as_values' => true,
                'choice_attr'       => function ($key, $val, $index) use ($disallowLead) {
                    // set "Contact" option disabled to true based on key or index of the choice.
                    if ('lead' === $key && $disallowLead) {
                        return ['disabled' => 'disabled'];
                    } else {
                        return [];
                    }
                },
                'expanded'          => false,
                'multiple'          => false,
                'label'             => 'mautic.lead.field.object',
                'empty_value'       => false,
                'attr'              => [
                    'class' => 'form-control',
                ],
                'required'          => false,
                'disabled'          => ($disabled || !$new),
                'data'              => $options['data']->getObject(),
            ]
        );

        // Add a bunch more 'custom' groups beside the original 4
        $builder->add(
            'group',
            'choice',
            [
                'choices' => [
                    'core'         => 'mautic.lead.field.group.core', // Personally Identifiable
                    'auto'         => 'mautic.lead.field.group.auto',
                    'client'       => 'mautic.lead.field.group.client',
                    'consent'      => 'mautic.lead.field.group.consent',
                    'education'    => 'mautic.lead.field.group.education',
                    'enhancement'  => 'mautic.lead.field.group.enhancement',
                    'finance'      => 'mautic.lead.field.group.finance',
                    'personal'     => 'mautic.lead.field.group.personal', // Health
                    'home'         => 'mautic.lead.field.group.home',
                    'politics'     => 'mautic.lead.field.group.politics',
                    'professional' => 'mautic.lead.field.group.professional',
                    'social'       => 'mautic.lead.field.group.social',
                    'system'       => 'mautic.lead.field.group.system',
                ],
                'attr' => [
                    'class'   => 'form-control',
                    'tooltip' => 'mautic.lead.field.form.group.help',
                ],
                'expanded'    => false,
                'multiple'    => false,
                'label'       => 'mautic.lead.field.group',
                'empty_value' => false,
                'required'    => false,
                'disabled'    => $disabled,
            ]
        );
    }
384462
public function addTextField(FormBuilderInterface $builder, string $name, array $options)
    {
        $builder->add(
            strtolower($name),
            TextType::class,
            array_merge_recursive(array("required" => false), $options)
        );

        return $this;
    }
701458
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        if($this->view == 'read_only'){
            $readOnly = true;
        } else {
            $readOnly = false;
        }

        $builder->add('name', 'text', array(
            'label' => 'Name',
//            'data' => $options['data']->getName(),
            'read_only' => $readOnly,
        ));

        if($this->view != 'hide_url'){
            $builder->add('URL', 'url', array(
                'label' => 'URL',
//                'data' => $options['data']->getUrl(),
                'read_only' => $readOnly,
            ));
        }

        if($this->view == 'checkbox'){
            $builder->add('selected', 'checkbox', array(
                'label'     => 'Add "'.$options['data']->getName().'" as location',
                'required'  => true,
                'data' => true,
                'mapped' => false,
                'attr' => array(
                    'align_with_widget' => true,
                ),
            ));
        }

        $hookListener = $this->getHookListener($builder);

        // Embed hook forms.
        $builder->addEventSubscriber($hookListener);
    }
1191046
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $entityAlias = $this->entityConfiguration['alias'];
        $entityIdGetter = $this->entityConfiguration['idGetter'];

        $fieldOptions = $this
            ->formConfig
            ->getOptions();

        $fieldType = $this
            ->formConfig
            ->getType()
            ->getName();

        foreach ($this->locales as $locale) {
            $translatedFieldName = $locale . '_' . $this->fieldName;

            $entityId = $this->entity->$entityIdGetter();
            $translationData = $entityId
                ? $this
                    ->entityTranslationProvider
                    ->getTranslation(
                        $entityAlias,
                        $entityId,
                        $this->fieldName,
                        $locale
                    )
                : '';

            $builder->add($translatedFieldName, $fieldType, [
                'required' => isset($fieldOptions['required'])
                    ? $this->evaluateRequired(
                        $fieldOptions['required'],
                        $locale
                    )
                    : false,
                'mapped' => false,
                'label' => $fieldOptions['label'],
                'data' => $translationData,
                'constraints' => $fieldOptions['constraints'],
            ]);
        }
    }