Beispiel #1
0
 /**
  * {@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());
     }
 }
Beispiel #2
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->setRequired($options['required'])->setDisabled($options['disabled'])->setErrorBubbling($options['error_bubbling'])->setEmptyData($options['empty_data'])->setPropertyPath(is_string($options['property_path']) ? $options['property_path'] : null)->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 (false === $options['property_path']) {
         trigger_error('Setting "property_path" to "false" is deprecated since version 2.1 and will be removed in 2.3. Set "mapped" to "false" instead.', E_USER_DEPRECATED);
     }
     if ($options['trim']) {
         $builder->addEventSubscriber(new TrimListener());
     }
 }
Beispiel #3
0
 /**
  * @param FormBuilderInterface $builder
  * @param array                $options
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('submit', SubmitType::class, ['label' => 'add'])->add('firstName', TextType::class, ['label' => 'firstname'])->add('leadStatus', ChoiceType::class, ['choices' => Lead::valuesOfStatus(), 'label' => 'lead.status'])->add('email', EmailType::class, ['label' => 'email'])->add('mobilePhone', NumberType::class, ['label' => 'mobilephone']);
     $builder->setRequired(false);
 }
Beispiel #4
0
 /**
  * @param FormBuilderInterface $builder
  * @param array                $options
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('name', TextType::class, ['label' => 'name'])->add('contact', EntityType::class, ['class' => 'AppBundle:Contact', 'choice_label' => 'name', 'label' => 'contact.title'])->add('stage', ChoiceType::class, ['choices' => Deal::valuesOfStage(), 'label' => 'stage'])->add('value', TextType::class, ['label' => 'value'])->add('currency', TextType::class, ['label' => 'currency'])->add('source', TextType::class, ['label' => 'source'])->add('tags', TextType::class, ['label' => 'tags'])->add('submit', SubmitType::class);
     $builder->setRequired(false);
 }
Beispiel #5
0
 /**
  * @param FormBuilderInterface $builder
  * @param array                $options
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('submit', SubmitType::class, ['label' => 'add'])->add('name', TextType::class, ['label' => 'name'])->add('code', TextType::class, ['label' => 'price']);
     $builder->setRequired(false);
 }