src/Form/AgencyRegistrationType.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use App\Form\Custom\CustomTextType;
  4. use Symfony\Component\Form\AbstractType;
  5. use Symfony\Component\Form\FormBuilderInterface;
  6. use Symfony\Bridge\Doctrine\Form\Type\EntityType;
  7. use Symfony\Component\Form\Extension\Core\Type\HiddenType;
  8. use Symfony\Component\Form\Extension\Core\Type\CountryType;
  9. use Symfony\Component\OptionsResolver\OptionsResolver;
  10. class AgencyRegistrationType extends AbstractType
  11. {
  12.     public function buildForm(FormBuilderInterface $builder, array $options)
  13.     {
  14.         $builder
  15.             ->add('userName'CustomTextType::class, array('mapped' => false))
  16.             ->add('userSurname'CustomTextType::class, array('mapped' => false))
  17.             ->add('userEmail'CustomTextType::class, array('mapped' => false))
  18.             ->add('name'CustomTextType::class)
  19.             ->add('fiscalCode'CustomTextType::class)
  20.             ->add('vat'CustomTextType::class)
  21.             ->add('vatCountry'CountryType::class, array('placeholder' => ''))
  22.             ->add('sdi'CustomTextType::class)
  23.             ->add('email'CustomTextType::class)
  24.             ->add('phone'CustomTextType::class)
  25.             ->add('iban'CustomTextType::class)
  26.             ->add('swift'CustomTextType::class)
  27.             ->add('street'CustomTextType::class, array('mapped' => false))
  28.             ->add('number'CustomTextType::class, array('mapped' => false))
  29.             ->add('internal'CustomTextType::class, array('mapped' => false))
  30.             ->add('stairs'CustomTextType::class, array('mapped' => false))
  31.             ->add('floor'CustomTextType::class, array('mapped' => false))
  32.             ->add('zip'CustomTextType::class, array('mapped' => false))
  33.             ->add('city'CustomTextType::class, array('mapped' => false))
  34.             ->add('province'CustomTextType::class, array('mapped' => false))
  35.             ->add('recaptcha'HiddenType::class, array("mapped" => false));
  36.     }
  37.     public function configureOptions(OptionsResolver $resolver)
  38.     {
  39.         $resolver->setDefaults(array(
  40.             'data_class' => 'App\Entity\Agency',
  41.             'validation_groups' => array('agency_registration')
  42.         ));
  43.     }
  44. }