- Ajout de la vue et du fonctionement de l'inscription.
- Ajout de la vue connexion.
This commit is contained in:
50
src/Form/RegistrationType.php
Normal file
50
src/Form/RegistrationType.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\User;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class RegistrationType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('email', EmailType::class, [
|
||||
'label' => 'Email',
|
||||
'attr' => ['class' => 'form-control']
|
||||
])
|
||||
->add('password', PasswordType::class, [
|
||||
'label' => 'Mot de passe',
|
||||
'attr' => ['class' => 'form-control']
|
||||
])
|
||||
->add('pseudo', TextType::class, [
|
||||
'label' => 'Pseudo',
|
||||
'attr' => ['class' => 'form-control']
|
||||
])
|
||||
->add('firstname', TextType::class, [
|
||||
'label' => 'Prénom',
|
||||
'attr' => ['class' => 'form-control']
|
||||
])
|
||||
->add('lastname', TextType::class, [
|
||||
'label' => 'Nom',
|
||||
'attr' => ['class' => 'form-control']
|
||||
])
|
||||
->add('submit', SubmitType::class, [
|
||||
'label' => 'S\'inscrire',
|
||||
'attr' => ['class' => 'btn btn-primary']
|
||||
]);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => User::class,
|
||||
]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user