src/Form/DirectoryLeadType.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use App\Entity\Lead;
  4. use Symfony\Component\Form\AbstractType;
  5. use Symfony\Component\Form\FormBuilderInterface;
  6. use Symfony\Component\OptionsResolver\OptionsResolver;
  7. use Symfony\Component\Form\Extension\Core\Type\HiddenType;
  8. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  9. use Symfony\Component\Form\Extension\Core\Type\TextType;
  10. use Symfony\Component\Form\Extension\Core\Type\TextareaType;
  11. use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  12. class DirectoryLeadType extends AbstractType
  13. {
  14.     public function buildForm(FormBuilderInterface $builder, array $options)
  15.     {
  16.         $builder
  17.             
  18.             ->add('ip_address'HiddenType::class, [
  19.             
  20.             ])
  21.             
  22.             ->add('company'HiddenType::class, [
  23.                 
  24.             ])
  25.             
  26.             ->add('firstname'TextType::class, [
  27.                 "label" => "First Name",
  28.                 "attr" => array (
  29.                     "placeholder" => "Your First Name",
  30.                     "class" => "form-control mb-2",
  31.                 ),
  32.             ])
  33.             
  34.             ->add('lastname'TextType::class, [
  35.                 "label" => "Last Name",
  36.                 "attr" => array (
  37.                     "placeholder" => "Your Last Name",
  38.                     "class" => "form-control mb-2",
  39.                 ),
  40.             ])
  41.             
  42.             ->add('email'EmailType::class, [
  43.                 "label" => "E-mail Address",
  44.                 "attr" => array (
  45.                     "placeholder" => "Your E-mail Address",
  46.                     "class" => "form-control mb-2",
  47.                 ),
  48.             ])
  49.             ->add('comments'TextareaType::class, [
  50.                 "label" => "Your Message",
  51.                 "attr" => array (
  52.                     "placeholder" => "Your Message",
  53.                     "class" => "form-control mb-2",
  54.                 ),
  55.             ])
  56.             ->add("Submit"SubmitType::class, array (
  57.                 "label" => "Submit",
  58.                 "attr" => array (
  59.                     "class" => "button mt-2"
  60.                 ),
  61.             ))
  62.             
  63.             /*
  64.             ->add('job_title')
  65.             ->add('phone_business')
  66.             ->add('phone_mobile')
  67.             ->add('address1')
  68.             ->add('address2')
  69.             ->add('city')
  70.             ->add('state')
  71.             ->add('zip')
  72.             ->add('last4')
  73.             ->add('country')
  74.             ->add('website')
  75.             ->add('type_business')
  76.             ->add('type_work')
  77.             ->add('year_established')
  78.             ->add('employee_size')
  79.             ->add('gender')
  80.             ->add('ethnicity')
  81.             ->add('sales_volume')
  82.             ->add('rcs_user')
  83.             ->add('ref_url')
  84.             ->add('user_agent')
  85.             ->add('created_at')
  86.             */
  87.             
  88.         ;
  89.     }
  90.     public function configureOptions(OptionsResolver $resolver)
  91.     {
  92.         $resolver->setDefaults([
  93.             'data_class' => Lead::class,
  94.         ]);
  95.     }
  96. }