src/Form/ResetPasswordRequestFormType.php line 14

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. use Karser\Recaptcha3Bundle\Form\Recaptcha3Type;
  9. use Karser\Recaptcha3Bundle\Validator\Constraints\Recaptcha3;
  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_attr' => ['class' => 'uk-form-label'],
  17.                 'attr' => ['autocomplete' => 'email''class' => 'uk-input'],
  18.                 'constraints' => [
  19.                     new NotBlank([
  20.                         'message' => 'Please enter your email',
  21.                     ]),
  22.                 ],
  23.             ])
  24.             ->add('captcha'Recaptcha3Type::class, [
  25.                 'constraints' => new Recaptcha3(),
  26.                 'action_name' => 'resetpassword',
  27.                 //'script_nonce_csp' => $nonceCSP,
  28.             ])
  29.         ;
  30.     }
  31.     public function configureOptions(OptionsResolver $resolver): void
  32.     {
  33.         $resolver->setDefaults([]);
  34.     }
  35. }