<?php
namespace App\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
class CBRCUserType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('email', EmailType::class, [
'attr' => ['class' => 'form-control'],
'row_attr' => ['class' => 'form-group'],
'label' => 'Email',
])
->add('plainPassword', RepeatedType::class, [
'type' => PasswordType::class,
'first_options' => ['label' => 'Mot de passe',
'attr' => ['class' => 'form-control'], 'row_attr' => ['class' => 'form-group']
],
'second_options' => ['label' => 'Confirmer le mot de passe',
'attr' => ['class' => 'form-control'], 'row_attr' => ['class' => 'form-group'],
],
'invalid_message' => 'Les mots de passe ne correspondent pas',
])
->add('recaptchatoken', HiddenType::class, [
'required' => false,
'mapped' => false,
])
->add('register', SubmitType::class, [
'row_attr' => ['class' => 'form-group'],
'attr' => ['class' => 'btn btn-block btn-maincolor mt-4'],
'label' => 'Création' ])
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
// Configure your form options here
]);
}
}
?>