src/Form/Frontend/ResetPasswordRequestFormType.php line 11

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