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


PHP FormBuilderInterface::add方法代码示例

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


在下文中一共展示了FormBuilderInterface::add方法的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

 /**
  * {@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

示例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)
 {
     $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

示例5: 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

示例6: 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

示例7: 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

示例8: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('label', 'text', array('required' => true, 'label' => 'oro.dashboard.label'));
     if ($options['create_new']) {
         $builder->add('startDashboard', 'oro_dashboard_select', array('required' => false, 'label' => 'oro.dashboard.start_dashboard'));
     }
 }
开发者ID:ramunasd,项目名称:platform,代码行数:10,代码来源:DashboardType.php

示例9: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('page_url', 'text', ['label' => 'mautic.page.point.action.form.page.url', 'label_attr' => ['class' => 'control-label'], 'attr' => ['class' => 'form-control', 'tooltip' => 'mautic.page.point.action.form.page.url.descr', 'placeholder' => 'http://']]);
     // $default = (isset($options['data']) && isset($options['data']['first_time'])) ? $options['data']['first_time'] : false;
     // $builder->add('first_time', 'yesno_button_group', array(
     //     'label'       => 'mautic.page.point.action.form.first.time.only',
     //     'attr'        => array(
     //         'tooltip' => 'mautic.page.point.action.form.first.time.only.descr'
     //     ),
     //     'data'        => $default
     // ));
     $builder->add('page_hits', 'integer', ['label' => 'mautic.page.hits', 'label_attr' => ['class' => 'control-label'], 'required' => false, 'attr' => ['class' => 'form-control', 'tooltip' => 'mautic.page.point.action.form.page.hits.descr']]);
     $formModifier = function (FormInterface $form, $data) use($builder) {
         $unit = isset($data['accumulative_time_unit']) ? $data['accumulative_time_unit'] : 'H';
         $form->add('accumulative_time_unit', 'hidden', ['data' => $unit]);
         $secondsTransformer = new SecondsConversionTransformer($unit);
         $form->add($builder->create('accumulative_time', 'text', ['label' => 'mautic.page.point.action.form.accumulative.time', 'required' => false, 'label_attr' => ['class' => 'control-label'], 'attr' => ['class' => 'form-control', 'tooltip' => 'mautic.page.point.action.form.accumulative.time.descr'], 'auto_initialize' => false])->addViewTransformer($secondsTransformer)->getForm());
         $unit = isset($data['returns_within_unit']) ? $data['returns_within_unit'] : 'H';
         $secondsTransformer = new SecondsConversionTransformer($unit);
         $form->add('returns_within_unit', 'hidden', ['data' => $unit]);
         $form->add($builder->create('returns_within', 'text', ['label' => 'mautic.page.point.action.form.returns.within', 'required' => false, 'label_attr' => ['class' => 'control-label'], 'attr' => ['class' => 'form-control', 'tooltip' => 'mautic.page.point.action.form.returns.within.descr', 'onBlur' => 'Mautic.EnablesOption(this.id)'], 'auto_initialize' => false])->addViewTransformer($secondsTransformer)->getForm());
         $unit = isset($data['returns_after_unit']) ? $data['returns_after_unit'] : 'H';
         $secondsTransformer = new SecondsConversionTransformer($unit);
         $form->add('returns_after_unit', 'hidden', ['data' => $unit]);
         $form->add($builder->create('returns_after', 'text', ['label' => 'mautic.page.point.action.form.returns.after', 'required' => false, 'label_attr' => ['class' => 'control-label'], 'attr' => ['class' => 'form-control', 'tooltip' => 'mautic.page.point.action.form.returns.after.descr', 'onBlur' => 'Mautic.EnablesOption(this.id)'], 'auto_initialize' => false])->addViewTransformer($secondsTransformer)->getForm());
     };
     $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use($formModifier) {
         $data = $event->getData();
         $formModifier($event->getForm(), $data);
     });
     $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use($formModifier) {
         $data = $event->getData();
         $formModifier($event->getForm(), $data);
     });
 }
开发者ID:dongilbert,项目名称:mautic,代码行数:38,代码来源:PointActionUrlHitType.php

示例10: buildForm

 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('name', 'text', ['label' => 'Task name', 'required' => true, 'constraints' => [new Assert\NotBlank()]]);
     $builder->add('period', 'integer', ['label' => 'Task period (in seconds)', 'required' => true, 'constraints' => [new Assert\NotBlank(), new Assert\GreaterThan(['value' => 0])]]);
     $builder->add('status', 'choice', ['label' => 'The task status', 'choices' => [Task::STATUS_STARTED => 'Started', Task::STATUS_STOPPED => 'Stopped']]);
     $builder->add('settings', 'hidden');
 }
开发者ID:luisbrito,项目名称:Phraseanet,代码行数:7,代码来源:TaskForm.php

示例11: buildForm

 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('enabled', 'choice', ['choices' => ['0' => 'Off', '1' => 'On'], 'multiple' => false, 'expanded' => true, 'required' => true]);
     $builder->add('name', 'text', ['disabled' => true]);
     $builder->add('type', 'text', ['disabled' => true]);
     $builder->add('icon', 'text', ['required' => true]);
 }
开发者ID:Kaik,项目名称:KaikMediaGallery,代码行数:7,代码来源:AbstractFeatureType.php

示例12: buildForm

 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('login', 'text');
     $builder->add('password', 'password');
     $builder->add('server', 'text');
     $builder->add('zaloguj', 'submit', array('label' => 'Zaloguj'));
 }
开发者ID:skrokbogumil,项目名称:KlientPoczty,代码行数:7,代码来源:LoginType.php

示例13: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('fieldName', 'text', array('label' => 'Field Name', 'block' => 'type'));
     $entityProvider = $this->configManager->getProvider('entity');
     $extendProvider = $this->configManager->getProvider('extend');
     $entityConfig = $extendProvider->getConfig($options['class_name']);
     if ($entityConfig->is('relation')) {
         $types = array();
         foreach ($entityConfig->get('relation') as $relationKey => $relation) {
             $fieldId = $relation['field_id'];
             $targetFieldId = $relation['target_field_id'];
             if (!$relation['assign'] || !$targetFieldId) {
                 continue;
             }
             if ($fieldId && $extendProvider->hasConfigById($fieldId) && !$extendProvider->getConfigById($fieldId)->is('state', ExtendManager::STATE_DELETED)) {
                 continue;
             }
             $entityLabel = $entityProvider->getConfig($targetFieldId->getClassName())->get('label');
             $fieldLabel = $entityProvider->getConfigById($targetFieldId)->get('label');
             $key = $relationKey . '||' . ($fieldId ? $fieldId->getFieldName() : '');
             $types[$key] = 'Relation (' . $entityLabel . ') ' . $fieldLabel;
         }
         $this->types = array_merge($this->types, $types);
     }
     $builder->add('type', 'choice', array('choices' => $this->types, 'empty_value' => 'Please choice type...', 'block' => 'type'));
 }
开发者ID:ashutosh-srijan,项目名称:findit_akeneo,代码行数:29,代码来源:FieldType.php

示例14: buildForm

 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('primer_nombre', 'filter_text', array('label' => 'Primer Nombre'));
     $builder->add('primer_apellido', 'filter_text', array('label' => 'Primer Apellido'));
     $builder->add('numero_documento', 'filter_text', array('label' => 'Número de Documento'));
     $builder->add('username', 'filter_text', array('label' => 'Nombre de usuario'));
 }
开发者ID:RMCProducciones,项目名称:CE,代码行数:7,代码来源:UsuarioFilterType.php

示例15: buildForm

 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('title', TextType::class);
     $builder->add('caption', CKEditorType::class, array('config' => array('uiColor' => '#ffffff')));
     $builder->add('panels', 'collection', array('type' => new PanelType(), 'allow_add' => true, 'allow_delete' => true, 'label' => "Carousel", 'options' => array('data_class' => 'Adam\\AdminBundle\\Entity\\Panel'), 'prototype' => true, 'attr' => array('class' => 'parent-collection', 'image' => "image")));
     $builder->add('homePageRows', 'collection', array('type' => new PanelType(), 'allow_add' => true, 'allow_delete' => true, 'label' => "Home Page Rows", 'options' => array('data_class' => 'Adam\\AdminBundle\\Entity\\Panel'), 'prototype' => true, 'attr' => array('class' => 'parent-collection', 'image' => "image")));
 }
开发者ID:adamprogers1986,项目名称:newcms,代码行数:7,代码来源:HomePageType.php


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