当前位置: 首页>>代码示例>>PHP>>正文


PHP Form\FormBuilderInterface类代码示例

本文整理汇总了PHP中Symfony\Component\Form\FormBuilderInterface的典型用法代码示例。如果您正苦于以下问题:PHP FormBuilderInterface类的具体用法?PHP FormBuilderInterface怎么用?PHP FormBuilderInterface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了FormBuilderInterface类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: buildForm

 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('author', 'text');
     $builder->add('email', 'email');
     $builder->add('website', 'url', array('required' => false));
     $builder->add('content', 'textarea');
 }
开发者ID:pitoukhmer,项目名称:protalk,代码行数:7,代码来源:CommentMedia.php

示例2: buildForm

 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('tags', TextType::class, array('label' => false, 'constraints' => array(new Length(array('min' => 2, 'max' => 50))), 'attr' => array('class' => 'form-control')));
     $builder->add('filter', ChoiceType::class, array('choices' => array('Tout' => 'all', 'Forum' => 'forum', 'Offres' => 'offer', 'Evenements' => 'hall', 'Profils' => 'profile'), 'choices_as_values' => true, 'expanded' => true, 'multiple' => false));
     $builder->add('method', ChoiceType::class, array('choices' => array('ET' => 'and', 'OU' => 'or'), 'choices_as_values' => true, 'expanded' => true, 'multiple' => false));
     $builder->add('no', TextType::class, array('label' => false, 'required' => false, 'constraints' => array(new Length(array('min' => 2, 'max' => 50))), 'attr' => array('class' => 'form-control')));
 }
开发者ID:yoannfleurydev,项目名称:amicale-src,代码行数:7,代码来源:SearchAdvancedType.php

示例3: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('body', null, array('attr' => array('rows' => 20), 'label' => 'lexik_mailer.translations.subject'));
     if ($options['with_language']) {
         $builder->add('lang', 'language', array('preferred_choices' => $options['preferred_languages'], 'label' => 'lexik_mailer.translations.subject'));
     }
 }
开发者ID:bendavies,项目名称:LexikMailerBundle,代码行数:10,代码来源:LayoutTranslationType.php

示例4: buildForm

 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $transformer = new ManyRelatedTransformer($this->doctrineRegistry, $options['entityName']);
     $viewTransformer = new ArrayToStringTransformer();
     $builder->addModelTransformer($transformer);
     $builder->addViewTransformer($viewTransformer);
 }
开发者ID:profcab,项目名称:ilios,代码行数:7,代码来源:ManyRelatedType.php

示例5: buildForm

 /**
  * @param FormBuilderInterface $builder
  * @param array $options
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('id', 'hidden');
     $builder->add('name', 'text', array('label' => 'bankholiday.field.name'));
     $builder->add('date', 'datePicker', array('label' => 'bankholiday.field.date'));
     $builder->add('memo', 'textarea', array('required' => false, 'label' => 'bankholiday.field.memo'));
 }
开发者ID:binaryfr3ak,项目名称:sfitixi,代码行数:11,代码来源:BankHolidayType.php

示例6: buildForm

 /**
  * @param FormBuilderInterface $builder
  * @param array $options
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('address', TextType::class, array('label' => 'Адрес доставки'));
     $builder->add('phone', TextType::class, array('label' => 'Телефон'));
     $builder->add('name', TextType::class, array('label' => 'ФИО'));
     $builder->add('submit', SubmitType::class, array('label' => 'Заказать'));
 }
开发者ID:novuscom,项目名称:cmfbundle,代码行数:11,代码来源:OrderType.php

示例7: buildForm

 /**
  * Builds the form.
  *
  * This method is called for each type in the hierarchy starting form the
  * top most type. Type extensions can further modify the form.
  *
  * @param FormBuilderInterface $builder The form builder
  * @param array $options The options
  *
  * @see FormTypeExtensionInterface::buildForm()
  *
  * @return void
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $folder = $options['folder'];
     $builder->add('name', null, array('label' => 'media.folder.addsub.form.name'))->add('rel', ChoiceType::class, array('choices' => array('media' => 'media', 'image' => 'image', 'slideshow' => 'slideshow', 'video' => 'video'), 'choices_as_values' => true, 'label' => 'media.folder.addsub.form.rel'))->add('parent', EntityType::class, array('class' => 'KunstmaanMediaBundle:Folder', 'choice_label' => 'optionLabel', 'label' => 'media.folder.addsub.form.parent', 'required' => true, 'query_builder' => function (FolderRepository $er) use($folder) {
         return $er->selectFolderQueryBuilder($folder);
     }))->add('internalName', TextType::class, array('label' => 'media.folder.addsub.form.internal_name', 'required' => false));
 }
开发者ID:bakie,项目名称:KunstmaanBundlesCMS,代码行数:20,代码来源:FolderType.php

示例8: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('email', EmailType::class, ['required' => true]);
     $builder->add('subject', TextType::class, ['required' => true]);
     $builder->add('content', TextareaType::class, ['required' => true]);
     $builder->add('captcha', CaptchaType::class, ['required' => true]);
 }
开发者ID:DeFreitas,项目名称:raphael.de-freitas.net,代码行数:10,代码来源:ContactType.php

示例9: buildForm

 /**
  * Builds the form.
  *
  * This method is called for each type in the hierarchy starting form the
  * top most type. Type extensions can further modify the form.
  *
  * @see FormTypeExtensionInterface::buildForm()
  *
  * @param FormBuilderInterface $builder The form builder
  * @param array $options The options
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('days', IntegerType::class, array('label' => 'kuma_lead_generation.form.recurring_every_x_time.days.label', 'required' => false));
     $builder->add('hours', IntegerType::class, array('label' => 'kuma_lead_generation.form.recurring_every_x_time.hours.label', 'required' => false));
     $builder->add('minutes', IntegerType::class, array('label' => 'kuma_lead_generation.form.recurring_every_x_time.minutes.label', 'required' => false));
     $builder->add('times', IntegerType::class, array('label' => 'kuma_lead_generation.form.recurring_every_x_time.times.label'));
 }
开发者ID:Kunstmaan,项目名称:KunstmaanLeadGenerationBundle,代码行数:18,代码来源:RecurringEveryXTimeAdminType.php

示例10: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->setRequired($options['required'])->setDisabled($options['disabled'])->setErrorBubbling($options['error_bubbling'])->setEmptyData($options['empty_data'])->setPropertyPath($options['property_path'])->setMapped($options['mapped'])->setByReference($options['by_reference'])->setVirtual($options['virtual'])->setCompound($options['compound'])->setData(isset($options['data']) ? $options['data'] : null)->setDataLocked(isset($options['data']))->setDataMapper($options['compound'] ? new PropertyPathMapper($this->propertyAccessor) : null);
     if ($options['trim']) {
         $builder->addEventSubscriber(new TrimListener());
     }
 }
开发者ID:nfabre,项目名称:symfony,代码行数:10,代码来源:FormType.php

示例11: buildForm

 /**
  * @param FormBuilderInterface $builder
  * @param array                $options
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $type = $builder->getData()->getNode()->getType();
     if (isset($this->nodeExtensions[$type])) {
         $this->nodeExtensions[$type]->buildForm($builder, $options);
     }
 }
开发者ID:clastic,项目名称:clastic,代码行数:11,代码来源:NodeTypeExtension.php

示例12: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->addModelTransformer($this->denormalizedEntityTransformer);
     $this->tagManager->setLocale($options['locale']);
     // On Pre-Submit, create the news posted Tags otherwise the form won't be valid
     $builder->addEventListener(FormEvents::PRE_SUBMIT, function ($event) use($options) {
         // Data when posted
         $tags = $event->getData();
         $entity = $event->getForm()->getParent()->getData();
         // Loop through the posted tags (if not numeric, it's a news Tag)
         if (is_array($tags)) {
             foreach ($tags as $key => $tagId) {
                 if (!is_numeric($tagId)) {
                     $tag = $this->tagManager->loadOrCreateTag($tagId, $options['use_global_tags'] ? null : $entity->getResourceType());
                     $tags[$key] = $tag->getId();
                     $entity->setTagsUpdatedAt(new \DateTime());
                 }
             }
             // Update the posted data with the newly created tags
             $event->setData($tags);
             $this->taggableListener->setNeedToFlush(true);
         } elseif (null === $tags && count($entity->getTags())) {
             // All tags are removed
             $this->taggableListener->setNeedToFlush(true);
         }
     }, 900);
 }
开发者ID:smart85,项目名称:UnifikDoctrineBehaviorsBundle,代码行数:30,代码来源:TaggableType.php

示例13: buildForm

 /**
  * Adds a CSRF field to the form when the CSRF protection is enabled.
  *
  * @param FormBuilderInterface $builder The form builder
  * @param array                $options The options
  */
 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));
 }
开发者ID:Kyra2778,项目名称:AMR,代码行数:13,代码来源:FormTypeCsrfExtension.php

示例14: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $deliveries = $options['deliveries'];
     $delivery = $options['delivery'];
     $deliveryDates = $options['deliveryDates'];
     $builder->add('delivery', 'entity', array('class' => 'Eccube\\Entity\\Delivery', 'property' => 'name', 'choices' => $deliveries, 'data' => $delivery))->add('deliveryDate', 'choice', array('choices' => $deliveryDates, 'required' => false, 'empty_value' => '指定なし'))->add('deliveryTime', 'entity', array('class' => 'Eccube\\Entity\\DeliveryTime', 'property' => 'deliveryTime', 'choices' => $delivery->getDeliveryTimes(), 'required' => false, 'empty_value' => '指定なし', 'empty_data' => null))->addEventSubscriber(new \Eccube\Event\FormEventSubscriber());
 }
开发者ID:hiroyasu55,项目名称:ec-cube,代码行数:10,代码来源:ShoppingMultipleType.php

示例15: DisableFieldSubscriber

 function it_builds_form(FormBuilderInterface $builder)
 {
     $builder->add('code')->shouldBeCalled();
     $builder->addEventSubscriber(new DisableFieldSubscriber('code'))->shouldBeCalled();
     $builder->add('label', 'pim_translatable_field', ['field' => 'label', 'translation_class' => 'Pim\\Bundle\\CatalogBundle\\Entity\\AssociationTypeTranslation', 'entity_class' => 'Pim\\Bundle\\CatalogBundle\\Entity\\AssociationType', 'property_path' => 'translations'])->shouldBeCalled();
     $this->buildForm($builder, []);
 }
开发者ID:ashutosh-srijan,项目名称:findit_akeneo,代码行数:7,代码来源:AssociationTypeTypeSpec.php


注:本文中的Symfony\Component\Form\FormBuilderInterface类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。