src/Form/ResetPasswordRequestFormType.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use App\Entity\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\NotBlank;
  9. use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  10. class ResetPasswordRequestFormType extends AbstractType
  11. {
  12.     public function buildForm(FormBuilderInterface $builder, array $options): void
  13.     {
  14.         $builder
  15.             ->add('email'EmailType::class, [
  16.                 'label' => "Email",
  17.                 'attr' => array(
  18.                     'placeholder' => "j.dupont@mail.com",
  19.                     'class' => "form-control"
  20.                 ),
  21.                 'constraints' => [
  22.                     new NotBlank([
  23.                         'message' => 'Vous devez rentrer un e-mail',
  24.                     ]),
  25.                 ],
  26.             ])
  27.         ;
  28.         $builder->add('save'SubmitType::class, array(
  29.             'label' => 'Confirmer',
  30.             'attr' => array('class' => 'button blue')
  31.         ));
  32.     }
  33.     public function configureOptions(OptionsResolver $resolver): void
  34.     {
  35.         $resolver->setDefaults(array(
  36.         ));
  37.     }
  38. }