src/Model/Form/ErrorFormType.php line 18

  1. <?php
  2. namespace App\Model\Form;
  3. use Ecommerce121\UtilBundle\Model\Form\EntityBuilderType;
  4. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  5. use Symfony\Component\Form\Extension\Core\Type\FileType;
  6. use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
  7. use Symfony\Component\Form\Extension\Core\Type\TextareaType;
  8. use Symfony\Component\Form\Extension\Core\Type\TextType;
  9. use Symfony\Component\Form\FormBuilderInterface;
  10. use Symfony\Component\OptionsResolver\OptionsResolver;
  11. use Symfony\Component\Validator\Constraints\NotBlank;
  12. /**
  13. * Class ContactForm.
  14. */
  15. class ErrorFormType extends EntityBuilderType
  16. {
  17. /**
  18. * {@inheritdoc}
  19. */
  20. public function buildForm(FormBuilderInterface $builder, array $options): void
  21. {
  22. parent::buildForm($builder, $options);
  23. $builder
  24. ->add('image', FileType::class, [
  25. 'label' => 'Examples include: Error message, pages with a loading screen, or bank statement with sensitive information removed',
  26. ])
  27. ->add('email', RepeatedType::class, [
  28. 'type' => EmailType::class,
  29. 'label' => 'Your Email',
  30. 'required' => true,
  31. 'first_options' => [
  32. 'label' => 'Email',
  33. ],
  34. 'second_options' => [
  35. 'label' => 'Confirm your email address',
  36. ],
  37. ])
  38. ->add('message', TextareaType::class, [
  39. 'label' => 'Please provide information that will help us investigate',
  40. 'required' => false,
  41. 'attr' => [
  42. 'row' => 5
  43. ]
  44. ]);
  45. }
  46. public function configureOptions(OptionsResolver $resolver): void
  47. {
  48. // $resolver->setDefaults(['data_class' => null]);
  49. }
  50. /**
  51. * {@inheritdoc}
  52. */
  53. public function getName(): string
  54. {
  55. return 'error_form';
  56. }
  57. }