Menu component form prototype definition.

@see FormInterface::buildForm()
970325
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('data', CollectionType::class, array(
                'entry_type' => PageMenuItemType::class,
                'allow_add' => true,
                'allow_delete' => true,
                'attr' => [
                    'class' => 'synapse-page-menu-data',
                ],
            ))
        ;
    }
917147
public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $schedule = $options['data'];
        $builder
            ->add('name', null, [
                'label' => 'schedule.form.name',
            ])
            ->add('location', null, [
                'label' => 'schedule.form.location',
            ])
            ->add('description', CKEditorType::class, [
                'label' => 'schedule.form.description',
                'config' => ['toolbar' => 'basic'],
                'required' => false, ])
            ->add('colour', ChoiceType::class, [
                'label' => 'schedule.form.colour',
                'required' => false,
                'choices' => [
                    'schedule.form.colour_choices.red' => 'important',
                    'schedule.form.colour_choices.green' => 'success',
                    'schedule.form.colour_choices.yellow' => 'warning',
                    'schedule.form.colour_choices.blue' => 'info',
                    'schedule.form.colour_choices.dark' => 'inverse',
                    'schedule.form.colour_choices.purple' => 'special',
                ],
            ])
            ->add('active', ChoiceType::class, [
                // Show "unpublished" instead of active.
                'choice_loader' => new CallbackChoiceLoader(function () use ($schedule) {
                    yield 'schedule.form.status_choices.active' => true;
                    if (!$schedule->isPublished()) {
                        yield 'schedule.form.status_choices.unpublished' => false;
                    } else {
                        yield 'schedule.form.status_choices.archived' => false;
                    }
                }),
                'label' => 'schedule.form.status',
            ])
            ->add('events', CollectionType::class, [
                'label' => 'schedule.form.events',
                'entry_type' => ScheduleEventType::class,
                'entry_options' => ['label' => false],
                'allow_add' => true,
                'allow_delete' => true,
                'by_reference' => false,
            ])
        ;
    }
1105739
public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $resource = $options['data'];
        $builder
            ->add('media', MediaType::class, [
                'label' => 'resource.form.file',
                'provider' => 'sonata.media.provider.file',
                'context' => 'default',
                'translation_domain' => BkstgResourceBundle::TRANSLATION_DOMAIN,
            ])
            ->add('name', TextType::class, [
                'label' => 'resource.form.name',
            ])
            ->add('description', CKEditorType::class, [
                'label' => 'resource.form.description',
                'config' => ['toolbar' => 'basic'],
                'required' => false,
            ])
            ->add('active', ChoiceType::class, [
                    // Show "unpublished" instead of active.
                    'choice_loader' => new CallbackChoiceLoader(function () use ($resource) {
                        yield 'resource.form.status_choices.active' => true;
                        if (!$resource->isPublished()) {
                            yield 'resource.form.status_choices.unpublished' => false;
                        } else {
                            yield 'resource.form.status_choices.archived' => false;
                        }
                    }),
                    'label' => 'resource.form.status',
            ])
            ->add('pinned', CheckboxType::class, [
                'label' => 'resource.form.pinned',
                'required' => false,
            ])
        ;
    }
959194
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        parent::buildForm($builder, $options);

        $this->addIban($builder)
            ->addBic($builder);
    }
545511
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('day_of_week_numbers', 'choice', array(
                'choices'   => DayOfWeek::getChoices(),
                'multiple'  => true,
                'expanded'  => true,
                'label'     => 'Days of Week',
            ))
            ->add('start_time', 'choice', array(
                'choices'   => WindowMaker::getStartTimeChoices(),
            ))
            ->add('end_time', 'choice', array(
                'choices'   => WindowMaker::getEndTimeChoices(),
            ))
            ->add('delivery_type', 'choice', array(
                'choices' => array(
                  HubWindow::DELIVERY_TYPE_PICKUP   => 'Pickup',
                  HubWindow::DELIVERY_TYPE_DELIVERY => 'Delivery',
                ),
                'multiple'  => false,
                'expanded'  => true,
            ))
        ;
    }
158474
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->addModelTransformer($this)
            ->add('name', TextType::class, array())
            ->add('online', ChoiceType::class, array(
                'expanded' => true,
                'multiple' => false,
                'choices' => array(
                    'Yes' => true,
                    'No' => false,
                ),
            ))
            ->add('meta', MetadataType::class, array(
                'label' => false,
                'supported_metadata' => array('title', 'description', 'keywords'),
            ))
            ->add('submit', SubmitType::class)
        ;
    }
493308
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add(
            'familyCode',
            FamilySelectorType::class,
            [
                'label' => false,
                'placeholder' => 'permission.family.placeholder',
                'horizontal_input_wrapper_class' => 'col-sm-12',
            ]
        );
        foreach (FamilyPermission::getPermissions() as $permission) {
            $builder->add(
                $permission,
                CheckboxType::class,
                [
                    'widget_checkbox_label' => 'widget',
                    'horizontal_input_wrapper_class' => 'col-sm-1',
                ]
            );
        }

        $builder->get('familyCode')->addModelTransformer(
            new CallbackTransformer(
                function ($originalData) {
                    if (null === $originalData) {
                        return null;
                    }
                    // Ignoring missing family
                    if (!$this->familyRegistry->hasFamily($originalData)) {
                        return null;
                    }

                    return $this->familyRegistry->getFamily($originalData);
                },
                function ($submittedData) {
                    if ($submittedData instanceof FamilyInterface) {
                        return $submittedData->getCode();
                    }

                    return $submittedData;
                }
            )
        );
    }
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',
        ));
    }
1199026
public function buildForm(array $form, FormStateInterface $form_state, $course_esid = NULL) {
    $this->course_esid = (int) $course_esid;
    if ($this->course_esid) {
      $step = (object) $this->databaseCourses->loadStep($this->course_esid);
      $this->step = $step;
      $this->course_id = $step->course_id;
      $this->course_sid = $step->course_sid;
      $this->course_eid = $step->course_eid;
    }
    return parent::buildForm($form, $form_state);
  }
280151
public function buildForm()
    {

        $this
            ->add($this->model->getKeyName(), 'hidden')
            ->add('email', 'email',
                [
                    'label'      => trans('expendable::form.email'),
                    'validation' => 'required,custom[email]',
                ]);

        $id = $this->model->getKey();

        if (!empty($id))
        {
            $this->add('change_password', 'checkbox', [
                'default_value' => 1,
                'label'         => trans('expendable::form.change_password_help'),
                'checked'       => false,
                'noInEditView'  => true
            ]);
        }

        $this->add('password', 'password',
            [
                'label'        => trans('expendable::form.password'),
                'attr'         => ['id' => 'password'],
                'validation'   => 'required',
                'noInEditView' => true
            ])
            ->add('password_match', 'password',
                [
                    'label'        => trans('expendable::form.repeat_password'),
                    'validation'   => 'required,equals[password]',
                    'noInEditView' => true
                ])
            ->add('status', 'choice', [
                'choices'     => StaticLabel::status(),
                'empty_value' => '-',
                'validation'  => 'required',
                'label'       => trans('expendable::form.status')
            ])
            ->add('role_id', 'choice', [
                'choices'     => Role::getChoice(),
                'empty_value' => '-',
                'validation'  => 'required',
                'label'       => trans('expendable::form.role')
            ])
            ->addDefaultActions();
    }
1125078
public function buildForm(FormBuilderInterface $builder, array $options)
	{
		$builder->add('title', TextType::class, array(
			'label' => 'Post title',
			'required' => true,
			'attr' => array('class' => 'doc-title')
		))
		->add('slug', TextType::class, array(
			'label' => 'Slug',
			'required' => true,
			'attr' => array('class' => 'doc-slug')
		))
		->add('state', ChoiceType::class, array(
			'label' => 'State',
			'required' => true,
			'choices' => array(
				'Draft' => DocumentModel::STATE_DRAFT, 
				'Waiting' => DocumentModel::STATE_WAITING, 
				'Published' => DocumentModel::STATE_PUBLISHED
			),
			'preferred_choices' => array(DocumentModel::STATE_DRAFT)
		))
		->add('content', TextareaType::class, array(
			'label' => 'Content',
			'required' => false,
			'attr' => array('class' => 'tinymce-content doc-content')
		));
	}
1032163
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        parent::buildForm($builder, $options);

        $builder->add(
            '__tab_password',
            TabType::class,
            [
                'label' => 'admin.user.tab.password.label',
                'inherit_data' => true,
            ]
        );
        /** @var FormBuilderInterface $passwordTab */
        $passwordTab = $builder->get('__tab_password');
        $passwordTab
            ->add(
                'plainPassword',
                RepeatedType::class,
                [
                    'type' => PasswordType::class,
                    'first_options' => ['label' => 'admin.user.form.password.label'],
                    'second_options' => ['label' => 'admin.user.form.repeat_password.label'],
                ]
            );
    }
1288231
public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('image', MediaType::class, [
                'label' => 'production.form.image',
                'translation_domain' => BkstgCoreBundle::TRANSLATION_DOMAIN,
                'provider' => 'sonata.media.provider.image',
                'context' => 'default',
            ])
            ->add('banner', MediaType::class, [
                'label' => 'production.form.banner',
                'translation_domain' => BkstgCoreBundle::TRANSLATION_DOMAIN,
                'provider' => 'sonata.media.provider.image',
                'context' => 'default',
            ])
            ->add('description', CKEditorType::class, [
                'label' => 'production.form.description',
                'required' => false,
                'config' => ['toolbar' => 'basic'],
            ])
        ;
    }
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(),
                        ))),
                    ),
                ));
            })
        ;
    }
97467
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->addModelTransformer($this)
            ->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($builder, $options) {
                $form = $event->getForm();
                $data = array(
                    'template_types' => null,
                    'templates' => array(),
                );

                // "templates"  field
                $templateFormBuilder = $builder->create('templates', null, array(
                    'compound' => true,
                    'auto_initialize' => false,
                ));
                $templateTypeChoices = array();

                // every template type got his own form
                foreach ($options['theme']->getTemplateTypes() as $templateType) {

                    // variation calculation
                    $variation = $this->variationResolver->resolve((new VariationContext())->denormalize(array(
                        'theme' => $options['theme'],
                        'content_type' => $contentType = $options['content_type'],
                        'template_type' => $templateType,
                    )));
                    if (!$templateType->supportsContentType(
                        $contentType->getName(),
                        $variation->getConfiguration('templates', $templateType->getName(), 'contents', array())
                    )) {
                        continue;
                    }

                    // template select entry
                    $templateTypeChoices[$templateType->getId()] = $templateType;

                    // template form construction
                    $template = $options['content']
                        ? $this->templateLoader->retrieveLocal($templateType, $options['content'])
                        : $this->templateLoader->retrieveGlobal($templateType, $contentType)
                    ;
                    if (!$template) {  // no template to edit : nothing to do
                        continue;
                    }

                    $data['templates'][$templateType->getName()] = $template;

                    $templateFormBuilder->add($templateType->getName(), TemplateType::class, array(
                        'auto_initialize' => false,
                        'content_type' => $options['content_type'],
                        'theme' => $options['theme'],
                        'template_type' => $templateType,
                        'variation' => $variation,
                    ));
                }

                $form
                    ->add('template_types', ChoiceType::class, array(
                        'required' => true,
                        'expanded' => false,
                        'auto_initialize' => false,
                        'choices' => $templateTypeChoices,
                        'mapped' => false,
                        'choice_value' => 'name',
                        'choice_label' => 'name',
                    ))
                    ->add($templateFormBuilder->getForm())
                ;

                $event->setData($data);
            })
        ;
    }
755778
protected function createComponentSignInForm(): Form
	{
		$form = $this->formFactory->create();
		$form->addProtection();

		$form->addText('username', 'cms.user.username')
			->setAttribute('autofocus', true)
			->setRequired();

		$form->addPassword('password', 'cms.user.password')
			->setRequired();

		$form->addCheckbox('remember', 'cms.user.staySignedIn');

		$form->addSubmit('send', 'cms.user.signIn');

		$form->onSuccess[] = [$this, 'signInFormSucceeded'];

		return $form;
	}
1152797
public function buildForm(FormBuilderInterface $builder, array $options)
	{
		$builder->add('name', TextType::class, array(
			'label' => 'Parameter name',
			'required' => true
		))
		->add('value', TextType::class, array(
			'label' => 'Parameter value',
			'required' => true,
		));
		
		$builder->add('config', HiddenType::class, array(
			'required' => true
		));
		
		$builder->get('config')->addModelTransformer(new IdToConfigTransformer($this->configManager));
	}