src/Form/ResetPasswordRequestFormType.php line 20

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Kreno package.
  4.  *
  5.  * (c) Valentin Van Meeuwen <contact@wikub.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace App\Form;
  11. use Symfony\Component\Form\AbstractType;
  12. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  13. use Symfony\Component\Form\FormBuilderInterface;
  14. use Symfony\Component\OptionsResolver\OptionsResolver;
  15. use Symfony\Component\Validator\Constraints\NotBlank;
  16. class ResetPasswordRequestFormType extends AbstractType
  17. {
  18.     public function buildForm(FormBuilderInterface $builder, array $options): void
  19.     {
  20.         $builder
  21.             ->add('email'EmailType::class, [
  22.                 'attr' => ['autocomplete' => 'email'],
  23.                 'constraints' => [
  24.                     new NotBlank([
  25.                         'message' => 'Please enter your email',
  26.                     ]),
  27.                 ],
  28.             ])
  29.         ;
  30.     }
  31.     public function configureOptions(OptionsResolver $resolver): void
  32.     {
  33.         $resolver->setDefaults([]);
  34.     }
  35. }