src/Form/ResetPasswordRequestFormType.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  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\NotBlank;
  8. class ResetPasswordRequestFormType extends Form
  9. {
  10.     public function buildForm(FormBuilderInterface $builder, array $options): void
  11.     {
  12.         $builder
  13.             ->add('email'EmailType::class, [
  14.                 'attr' => array_merge(
  15.                     $this->inputAttr,
  16.                     [
  17.                         'autocomplete' => 'email',
  18.                     ]
  19.                 ),
  20.                 'constraints' => [
  21.                     new NotBlank([
  22.                         'message' => 'Please enter your email',
  23.                     ]),
  24.                 ],
  25.             ]);
  26.     }
  27.     public function configureOptions(OptionsResolver $resolver): void
  28.     {
  29.         $resolver->setDefaults([]);
  30.     }
  31. }