src/AppBundle/Form/Customer/AgentContactFormType.php line 12

Open in your IDE?
  1. <?php
  2. namespace AppBundle\Form\Customer;
  3. use Symfony\Component\Form\AbstractType;
  4. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  5. use Symfony\Component\Form\FormBuilderInterface;
  6. use Symfony\Component\OptionsResolver\OptionsResolver;
  7. use Symfony\Component\Validator\Constraints\Length;
  8. use Symfony\Component\Validator\Constraints\NotBlank;
  9. class AgentContactFormType extends AbstractType
  10. {
  11.     /**
  12.      * {@inheritdoc}
  13.      */
  14.     public function buildForm(FormBuilderInterface $builder, array $options)
  15.     {
  16.         $builder
  17.             ->add('name'null, [
  18.                 'label' => false,
  19.                 'attr' => ['class'=> 'form-control input-sm''placeholder' => 'ImiÄ™ i nazwisko / nazwa firmy''required' => true],
  20.                 'translation_domain' => false,
  21.                 'constraints' => [
  22.                     new NotBlank(),
  23.                     new Length(['min' => 3]),
  24.                 ]
  25.             ])
  26.             ->add('address'null, [
  27.                 'label' => false,
  28.                 'attr' => ['class'=> 'form-control input-sm''placeholder' => 'Adres''required' => true],
  29.                 'translation_domain' => false,
  30.                 'constraints' => [
  31.                     new NotBlank(),
  32.                     new Length(['min' => 3]),
  33.                 ]
  34.             ])
  35.             ->add('regon'null, [
  36.                 'label' => false,
  37.                 'attr' => ['class'=> 'form-control input-sm''placeholder' => 'Regon''required' => false],
  38.                 'translation_domain' => false
  39.             ])
  40.             ->add('phone'null, [
  41.                 'label' => false,
  42.                 'attr' => ['class'=> 'form-control input-sm''placeholder' => 'Numer telefonu''required' => true],
  43.                 'translation_domain' => false,
  44.                 'constraints' => [
  45.                     new NotBlank(),
  46.                     new Length(['min' => 9]),
  47.                 ]
  48.             ])
  49.             ->add('email'EmailType::class, [
  50.                 'label' => false,
  51.                 'attr' => ['class'=> 'form-control input-sm''placeholder' => 'E-mail''required' => true],
  52.                 'translation_domain' => false,
  53.                 'constraints' => [
  54.                     new NotBlank(),
  55.                     new Length(['min' => 3]),
  56.                 ]
  57.             ])
  58.             ->add('www'null, [
  59.                 'label' => false,
  60.                 'attr' => ['class'=> 'form-control input-sm''placeholder' => 'WWW''required' => false],
  61.                 'translation_domain' => false
  62.             ])
  63.             ->add('rodo'null, [
  64.                 'label' => false,
  65.                 'attr' => ['class'=> 'form-check-input''required' => true],
  66.                 'translation_domain' => false,
  67.                 'constraints' => [
  68.                     new NotBlank()
  69.                 ]
  70.             ])
  71.             ->add('experience'null, [
  72.                 'label' => false,
  73.                 'attr' => ['class'=> 'ml-4''required' => false],
  74.                 'translation_domain' => false
  75.             ])
  76.             ->add('ownLocal'null, [
  77.                 'label' => false,
  78.                 'attr' => ['class'=> 'ml-4''required' => false],
  79.                 'translation_domain' => false
  80.             ])
  81.             ->add('businessActivity'null, [
  82.                 'label' => false,
  83.                 'attr' => ['class'=> 'ml-4''required' => false],
  84.                 'translation_domain' => false
  85.             ])
  86.         ;
  87.     }/**
  88.      * {@inheritdoc}
  89.      */
  90.     public function configureOptions(OptionsResolver $resolver)
  91.     {
  92.         $resolver->setDefaults(array(
  93.             'data_class' => 'AppBundle\Entity\Customer\AgentContactForm'
  94.         ));
  95.     }
  96.     /**
  97.      * {@inheritdoc}
  98.      */
  99.     public function getBlockPrefix()
  100.     {
  101.         return 'appbundle_customer_agentcontactform';
  102.     }
  103. }