src/Form/Type/BFUserType.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Form\Type;
  3. use Symfony\Component\Form\AbstractType;
  4. use Symfony\Component\Form\FormBuilderInterface;
  5. use Symfony\Component\OptionsResolver\OptionsResolver;
  6. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  7. use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
  8. use Symfony\Component\Form\Extension\Core\Type\PasswordType;
  9. use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
  10. use Symfony\Component\Form\Extension\Core\Type\HiddenType;
  11. use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  12. class BFUserType extends AbstractType
  13. {
  14.     public function buildForm(FormBuilderInterface $builder, array $options)
  15.     {
  16.         $builder
  17.             ->add('email'EmailType::class, [
  18.                 'attr' => ['class' => 'form-control'],
  19.                 'row_attr' => ['class' => 'form-group'],
  20.                 'label' => 'Email',
  21.             ])
  22.             ->add('plainPassword'RepeatedType::class, [
  23.                 'type' => PasswordType::class,
  24.                 'first_options'  => ['label' => 'Mot de passe'
  25.                                           'attr' => ['class' => 'form-control'],         'row_attr' => ['class' => 'form-group']
  26.                                     ],
  27.                 'second_options' => ['label' => 'Confirmer le mot de passe',
  28.                                          'attr' => ['class' => 'form-control'],         'row_attr' => ['class' => 'form-group'],
  29.                                     ],
  30.                 'invalid_message' => 'Les mots de passe ne correspondent pas',
  31.             ])
  32.             ->add('recaptchatoken'HiddenType::class, [
  33.                 'required' => false,
  34.                 'mapped' => false,
  35.             ])
  36.             ->add('register'SubmitType::class, [
  37.                 'attr' => ['class' => 'btn btn-block btn-primary mt-4'],
  38.                 'label' => 'Création' ])
  39.         ;
  40.     }
  41.     public function configureOptions(OptionsResolver $resolver)
  42.     {
  43.         $resolver->setDefaults([
  44.             // Configure your form options here
  45.         ]);
  46.     }
  47. }
  48. ?>