src/Form/User/UserForgottenPasswordType.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Form\User;
  3. use App\Model\User\User;
  4. use Symfony\Component\Form\AbstractType;
  5. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  6. use Symfony\Component\Form\FormBuilderInterface;
  7. use Symfony\Component\OptionsResolver\OptionsResolver;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. class UserForgottenPasswordType extends AbstractType
  10. {
  11.     public function buildForm(FormBuilderInterface $builder, array $options)
  12.     {
  13.         $builder->add('email'EmailType::class, [
  14.             'required' => true,
  15.             'constraints' => [
  16.                 new Assert\NotBlank(),
  17.             ]
  18.         ]);
  19.     }
  20.     public function configureOptions(OptionsResolver $resolver)
  21.     {
  22.         $resolver->setDefaults([
  23.             'data_class' => User::class,
  24.             'csrf_protection' => false,
  25.         ]);
  26.     }
  27. }