src/Form/ForgotPasswordType.php line 12

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\Email;
  8. use Symfony\Component\Validator\Constraints\Sequentially;
  9. class ForgotPasswordType extends AbstractType
  10. {
  11.     public function buildForm(FormBuilderInterface $builder, array $options): void
  12.     {
  13.         $builder
  14.             ->add('email'EmailType::class, [
  15.                 'label'      => '<i class="far fa-envelope fa-fw"></i> Adresse email',
  16.                 'label_html' => true,
  17.                 'attr'       => [
  18.                     'placeholder' => 'Votre email',
  19.                     'autofocus'   => true,
  20.                     'class'       => 'form-control',
  21.                 ],
  22.                 'constraints' => [
  23.                     new Sequentially([
  24.                         new Email(),
  25.                     ]),
  26.                 ],
  27.             ])
  28.         ;
  29.     }
  30.     public function configureOptions(OptionsResolver $resolver): void
  31.     {
  32.         $resolver->setDefaults([
  33.             'data_class' => null,
  34.         ]);
  35.     }
  36. }