mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 21:57:16 +02:00
Added new registration form
This commit is contained in:
33
application/src/Form/UserType.php
Normal file
33
application/src/Form/UserType.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\User;
|
||||
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\TextType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
|
||||
|
||||
class UserType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('username', TextType::class)
|
||||
->add('plainPassword', RepeatedType::class, array(
|
||||
'type' => PasswordType::class,
|
||||
'first_options' => array('label' => 'Password'),
|
||||
'second_options' => array('label' => 'Repeat Password'),
|
||||
))
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => User::class,
|
||||
));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user