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 as Assert;
  8. class ResetPasswordRequestFormType extends AbstractType
  9. {
  10.     public function buildForm(FormBuilderInterface $builder, array $options): void
  11.     {
  12.         $builder
  13.             ->add('email'EmailType::class, [
  14.                 'label' => 'Email',
  15.                 'attr' => ['autocomplete' => 'email'],
  16.                 'required' => false,
  17.                 'constraints' => [
  18.                     new Assert\NotBlank([
  19.                         'message' => 'Unesite svoj email',
  20.                     ]),
  21.                 ],
  22.             ]);
  23.     }
  24.     public function configureOptions(OptionsResolver $resolver): void
  25.     {
  26.         $resolver->setDefaults([]);
  27.     }
  28. }