src/Form/Account/CreationType.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Form\Account;
  3. use App\Form\AbstractFrontType;
  4. use EWZ\Bundle\RecaptchaBundle\Form\Type\EWZRecaptchaType;
  5. use EWZ\Bundle\RecaptchaBundle\Validator\Constraints\IsTrue;
  6. use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
  7. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  8. use Symfony\Component\Form\Extension\Core\Type\IntegerType;
  9. use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
  10. use Symfony\Component\Form\Extension\Core\Type\TextType;
  11. use Symfony\Component\Form\FormBuilderInterface;
  12. use Symfony\Component\Validator\Constraints\NotBlank;
  13. use App\Actimage\CaptchaBundle\Form\Type\ActimageCaptchaType;
  14. class CreationType extends AbstractFrontType
  15. {
  16.     public function buildForm(FormBuilderInterface $builder, array $options): void
  17.     {
  18.         $builder
  19.             ->add('connexionId'TextType::class, [
  20.                 'label'       => 'account_creation.step1.form.connexion_id.label',
  21.                 'required'    => true,
  22.                 'constraints' => [new NotBlank()],
  23.             ])
  24.             ->add('customerNumber'IntegerType::class, [
  25.                 'label'       => 'account_creation.step1.form.customer_number.label',
  26.                 'empty_data'  => null,
  27.                 'required'    => true,
  28.                 'constraints' => [new NotBlank()],
  29.             ])
  30.             ->add('email'RepeatedType::class, [
  31.                 'type'               => EmailType::class,
  32.                 'translation_domain' => 'front',
  33.                 'invalid_message'    => 'account_creation.step1.form.emails_not_matching',
  34.                 'first_name'         => 'email1',
  35.                 'required'           => true,
  36.                 'first_options'      => ['label' => 'account_creation.step1.form.email1'],
  37.                 'second_name'        => 'email2',
  38.                 'second_options'     => ['label' => 'account_creation.step1.form.email2'],
  39.                 'constraints'        => [new NotBlank()],
  40.             ])
  41.             ->add('rgpd'CheckboxType::class, [
  42.                 'label'       => 'account_creation.form.rgpd.label',
  43.                 'mapped'      => false,
  44.                 'required'    => true,
  45.                 'constraints' => [new NotBlank()],
  46.             ])
  47. //            ->add('recaptcha', EWZRecaptchaType::class, [
  48. //                'label'       => false,
  49. //                'mapped'      => false,
  50. //                'required'    => true,
  51. //                'constraints' => [new IsTrue()],
  52. //            ]);
  53.             ->add('captcha'ActimageCaptchaType::class, [
  54.                 'label'       => false,
  55.                 'mapped'      => false,
  56.                 'required'    => true,
  57.             ]);
  58.     }
  59. }