@param \Symfony\Component\Form\FormBuilderInterface $builder
@param array $options

@return void
174767
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        parent::buildForm($builder, $options);

        $this->addBankGroupType($builder, $options);
    }
393268
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('containerTag', ChoiceType::class, [
                'label'          => 'widget_layout.form.containerTag.label',
                'vic_help_block' => 'widget_layout.form.containerTag.help_block',
                'choices'        => array_combine(Widget::$tags, Widget::$tags),
            ])
            ->add('containerClass', null, [
                'label'    => 'widget_layout.form.containerClass.label',
                'required' => false,
            ])
            ->add('vicActiveTab', HiddenType::class, [
                'required' => false,
                'mapped'   => false,
            ])
            ->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
                /*
                 * Generate form fields for each part of form
                 * Example, generate Static content, XS and SM as color forms
                 * Whereas MD and LG are image forms
                 */
                foreach ($this->victoire_twig_responsive as $key) {
                    self::generateBackgroundFields($event->getForm(), $key, $event->getData()->{'getContainerBackgroundType'.$key}());
                }
            });

        foreach ($this->victoire_twig_responsive as $key) {
            /*
             * Build global fields for all parts of form
             */
            $builder
                ->add('containerMargin'.$key, null, [
                    'label'          => 'widget_layout.form.containerMargin'.$key.'.label',
                    'vic_help_block' => 'widget_layout.form.containerMargin.help_block',
                    'required'       => false,
                ])
                ->add('containerPadding'.$key, null, [
                    'label'          => 'widget_layout.form.containerPadding'.$key.'.label',
                    'vic_help_block' => 'widget_layout.form.containerPadding.help_block',
                    'required'       => false,
                ])
                ->add('containerWidth'.$key, null, [
                    'label' => 'widget_layout.form.containerWidth'.$key.'.label',
                    'attr'  => ['placeholder' => 'widget_layout.form.containerWidth.placeholder'],
                ])
                ->add('containerHeight'.$key, null, [
                    'label' => 'widget_layout.form.containerHeight'.$key.'.label',
                    'attr'  => ['placeholder' => 'widget_layout.form.containerWidth.placeholder'],
                ])
                ->add('textAlign'.$key, ChoiceType::class, [
                    'label'    => 'widget_layout.form.textAlign'.$key.'.label',
                    'required' => false,
                    'choices'  => [
                        'widget_layout.form.textAlign.choices.left.label'    => 'left',
                        'widget_layout.form.textAlign.choices.center.label'  => 'center',
                        'widget_layout.form.textAlign.choices.right.label'   => 'right',
                        'widget_layout.form.textAlign.choices.justify.label' => 'justify',
                    ],
                    'placeholder'       => 'widget_layout.form.textAlign.choices.placeholder',
                    'choices_as_values' => true,
                ])
                ->add('containerBackgroundType'.$key, ChoiceType::class, [
                    'label'    => 'widget_layout.form.containerBackgroundType'.$key.'.label',
                    'required' => false,
                    'choices'  => [
                        'widget_layout.form.containerBackgroundType.choices.color.label' => 'color',
                        'widget_layout.form.containerBackgroundType.choices.image.label' => 'image',
                    ],
                    'placeholder'       => 'widget_layout.form.containerBackgroundType.choices.placeholder',
                    'choices_as_values' => true,
                    'attr'              => [
                        'data-refreshOnChange' => 'true',
                    ],
                ])
                ->get('containerBackgroundType'.$key)->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($key) {
                    self::generateBackgroundFields($event->getForm()->getParent(), $key, $event->getData());
                });
        }

        // add theme field
        $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
            $data = $event->getData();
            $form = $event->getForm();
            //guess the bundle name
            $widgetBundle = self::getBundleNameFromEntity(get_class($data), $this->kernel->getBundles());
            //search for available theme files
            $finder = Finder::create()
                ->files()
                ->name('/^show(.)+\.html\.twig$/')
                ->in($this->fileLocator->locate('@'.$widgetBundle.'/Resources/views', null, false))
                ->sortByName();

            $choices = [];
            //prepare choices by adding in each theme
            foreach ($finder as $key => $file) {
                $theme = $file->getRelativePathname();
                $theme = preg_replace('/show|\.html\.twig/', '', $theme);
                $choices['victoire.'.$widgetBundle.'.theme.'.$theme.'.label'] = $theme;
            }
            //We add the theme type only if there is a choice
            if (count($choices)) {
                $form->add('theme', ChoiceType::class, [
                    'label'             => 'widget.form.theme.label',
                    'choices'           => $choices,
                    'choices_as_values' => true,
                    'placeholder'       => 'victoire.theme.default.label',
                ]);
            }
        });
    }
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()]);
    }
856035
public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $this->assertOptionsAreValid($options);

        foreach ($options['options'] as $i => $option) {
            if (!$option instanceof ProductOptionInterface) {
                throw new InvalidConfigurationException(
                    sprintf('Each object passed as option list must implement "%s"', ProductOptionInterface::class)
                );
            }

            $builder->add((string) $option->getCode(), ProductOptionValueChoiceType::class, [
                'label' => $option->getName() ?: $option->getCode(),
                'option' => $option,
                'property_path' => '[' . $i . ']',
                'block_name' => 'entry',
            ]);
        }
    }
870752
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->addModelTransformer($this)

            ->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($builder, $options) {
                $form = $event->getForm();
                $zone = $event->getData();

                // Create a component form for each into given zone
                $form->add('components', CollectionType::class, array(
                    'auto_initialize' => false,
                    'allow_add' => false,
                    'allow_delete' => false,
                    'entry_type' => ComponentType::class,
                    'entry_options' => array(
                        'variation' => $this->variationResolver->resolve((new VariationContext())->denormalize(array(
                            'theme' => $options['theme'],
                            'content_type' => $options['content_type'],
                            'template_type' => $options['template_type'],
                            'zone_type' => $zone->getZoneType(),
                        ))),
                    ),
                ));
            })
        ;
    }
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());
                }
            }
        );
    }
410440
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        /** @var AttributeInterface $attribute */
        $attribute = $options['attribute'];

        $builder
            ->add(
                'enabled',
                CheckboxType::class,
                [
                    'widget_checkbox_label' => 'label',
                ]
            )
            ->add(
                'column',
                TextType::class,
                [
                    'data' => $attribute->getCode(),
                ]
            );

        if ($attribute->getType()->isRelation()) {
            $builder->add(
                'serializedColumn',
                ChoiceType::class,
                [
                    'choices' => [
                        'EAV Identifier' => 'identifier',
                        'Doctrine Id' => 'id',
                        'Label (WARNING: not re-importable)' => 'label',
                    ],
                ]
            );
        }
    }
525745
protected function addViewTypeForm(FormBuilderInterface $builder, array $options): void
    {
        /** @var \Netgen\BlockManager\Block\BlockDefinitionInterface $blockDefinition */
        $blockDefinition = $options['block']->getDefinition();

        $this->processViewTypeConfig($blockDefinition);

        $builder->add(
            'view_type',
            ChoiceType::class,
            [
                'label' => 'block.view_type',
                'choices' => array_flip($this->viewTypes),
                'property_path' => 'viewType',
            ] + $this->getChoicesAsValuesOption()
        );

        $builder->add(
            'item_view_type',
            ChoiceType::class,
            [
                'label' => 'block.item_view_type',
                'choices' => array_flip(call_user_func_array('array_merge', $this->itemViewTypes)),
                'choice_attr' => function ($value): array {
                    return [
                        'data-master' => implode(',', $this->viewTypesByItemViewType[$value]),
                    ];
                },
                'property_path' => 'itemViewType',
            ] + $this->getChoicesAsValuesOption()
        );
    }
1374829
public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $event = $options['data'];
        $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('location', null, [
                'label' => 'event.form.location',
            ])
            ->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,
            ])
            ->add('colour', ChoiceType::class, [
                'label' => 'event.form.colour',
                'required' => false,
                'choices' => [
                    'event.form.colour_choices.red' => 'important',
                    'event.form.colour_choices.green' => 'success',
                    'event.form.colour_choices.yellow' => 'warning',
                    'event.form.colour_choices.blue' => 'info',
                    'event.form.colour_choices.dark' => 'inverse',
                    'event.form.colour_choices.purple' => 'special',
                ],
            ])
            ->add('active', ChoiceType::class, [
                // Show "unpublished" instead of active.
                'choice_loader' => new CallbackChoiceLoader(function () use ($event) {
                    yield 'event.form.status_choices.active' => true;
                    if (!$event->isPublished()) {
                        yield 'event.form.status_choices.unpublished' => false;
                    } else {
                        yield 'event.form.status_choices.archived' => false;
                    }
                }),
                'label' => 'event.form.status',
            ])
        ;
    }
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)
            )
        ;
    }
1241367
public function buildForm (FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('name', 'text', array(
                'label' => 'Nom du groupe'
            ))
            ->add('roles', 'choice', array(
                'label' => 'Rôles',
                'choices' => $this->getRoles(),
                'multiple' => true,
                'expanded' => true
            ))
            ->add('users', 'olix_doublelist_entity', array(
                'label' => 'Utilisateurs',
                'class' => 'OlixSecurityBundle:User',
                'property' => 'name',
                'mapped' => false
            ))
        ;
    }
484995
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $this->addOnlineBankTransferType($builder, $options)
            ->addBankCountry($builder, $options);
    }
246242
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('idPage', 'hidden', array('label' => 'pages_controller_label_permalink'));
        $builder->add('idLanguage', 'choice', array('choices' => ChoiceValues::getLanguages($this->languageRepository)));
        $builder->add('permalink', 'textarea', array(
            'label' => 'pages_controller_label_permalink',
            'attr' => array(
                'rows' => '3',
            ),));
        $builder->add('title', 'textarea', array(
            'label' => 'pages_controller_label_meta_title',
            'attr' => array(
                'title' => 'pages_controller_meta_title_explanation',
                'rows' => '3',
            ),
        ));
        $builder->add('description', 'textarea', array(
            'label' => 'pages_controller_label_meta_description',
            'attr' => array(
                'title' => 'pages_controller_meta_description_explanation',
                'rows' => '3',
            ),
        ));
        $builder->add('keywords', 'textarea', array(
            'label' => 'pages_controller_label_meta_keywords',
            'attr' => array(
                'title' => 'pages_controller_meta_keywords_explanation',
                'rows' => '2',
            ),
        ));
        $builder->add('sitemapChangeFreq', 'choice', array(
            'choices' => array(
                '' => '-',
                'always' => 'always',
                'hourly' => 'hourly',
                'daily' => 'daily',
                'weekly' => 'weekly',
                'monthly' => 'monthly',
                'yearly' => 'yearly',
                'never' => 'never',
            ),
            'label' => 'pages_controller_label_change frequency',
        ));
        $builder->add('sitemapPriority', 'choice', array(
            'choices' => array(
                '0.0' => '0.0',
                '0.1' => '0.1',
                '0.2' => '0.2',
                '0.3' => '0.3',
                '0.4' => '0.4',
                '0.5' => '0.5',
                '0.6' => '0.6',
                '0.7' => '0.7',
                '0.8' => '0.8',
                '0.9' => '0.9',
                '1.0' => '1.0',
            ),
            'data' => '0.5',
            'label' => 'pages_controller_label_priority',
        ));
    }
1297364
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        if (null !== $this->parent) {
            $this->parent->buildForm($builder, $options);
        }

        $this->innerType->buildForm($builder, $options);

        foreach ($this->typeExtensions as $extension) {
            $extension->buildForm($builder, $options);
        }
    }
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);
    }
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',
            ]);
    }
755251
public function buildValuesForm(FormBuilderInterface $builder, array $options = [])
    {
        /** @var FamilyInterface $family */
        $family = $options['family'];

        $attributes = $family->getAttributes();
        if ($options['attributes_config']) {
            if (!$options['merge_attributes_config']) {
                $attributes = [];
            }
            foreach (array_keys($options['attributes_config']) as $attributeCode) {
                $attributes[$attributeCode] = $family->getAttribute($attributeCode);
            }
        }

        foreach ($attributes as $attribute) {
            $this->attributeFormBuilder->addAttribute(
                $builder,
                $attribute,
                $this->resolveAttributeConfig($attribute, $options)
            );
        }
    }