src/Form/ResetPasswordRequestFormType.php line 11

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\NotBlank;
  8. class ResetPasswordRequestFormType extends AbstractType
  9. {
  10.     public function buildForm(FormBuilderInterface $builder, array $options): void
  11.     {
  12.         $builder
  13.             ->add('email'EmailType::class, [
  14.                 'attr' => [
  15.                     'autocomplete' => 'email',
  16.                     'class' => 'form-control bg-transparent text-dark',
  17.                     'placeholder' => 'Ex : hello@localbeez.fr'
  18.                 ],
  19.                 'label_attr' => [
  20.                     'class' => 'form-label'
  21.                 ],
  22.                 'row_attr' => [
  23.                     'class' => 'd-flex flex-column align-items-start mb-3'
  24.                 ],
  25.                 'label' => 'Email :',
  26.                 'constraints' => [
  27.                     new NotBlank([
  28.                         'message' => "L'email est obligatoire !",
  29.                     ]),
  30.                 ],
  31.             ])
  32.         ;
  33.     }
  34.     public function configureOptions(OptionsResolver $resolver): void
  35.     {
  36.         $resolver->setDefaults([]);
  37.     }
  38. }