diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Form/Type/NewUserType.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Form/Type/NewUserType.php | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/Wallabag/CoreBundle/Form/Type/NewUserType.php b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php index 8aabc8bb..ffbe9ba2 100644 --- a/src/Wallabag/CoreBundle/Form/Type/NewUserType.php +++ b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php | |||
@@ -3,6 +3,11 @@ | |||
3 | namespace Wallabag\CoreBundle\Form\Type; | 3 | namespace Wallabag\CoreBundle\Form\Type; |
4 | 4 | ||
5 | use Symfony\Component\Form\AbstractType; | 5 | use Symfony\Component\Form\AbstractType; |
6 | use Symfony\Component\Form\Extension\Core\Type\EmailType; | ||
7 | use Symfony\Component\Form\Extension\Core\Type\PasswordType; | ||
8 | use Symfony\Component\Form\Extension\Core\Type\RepeatedType; | ||
9 | use Symfony\Component\Form\Extension\Core\Type\SubmitType; | ||
10 | use Symfony\Component\Form\Extension\Core\Type\TextType; | ||
6 | use Symfony\Component\Form\FormBuilderInterface; | 11 | use Symfony\Component\Form\FormBuilderInterface; |
7 | use Symfony\Component\OptionsResolver\OptionsResolver; | 12 | use Symfony\Component\OptionsResolver\OptionsResolver; |
8 | use Symfony\Component\Validator\Constraints; | 13 | use Symfony\Component\Validator\Constraints; |
@@ -12,9 +17,9 @@ class NewUserType extends AbstractType | |||
12 | public function buildForm(FormBuilderInterface $builder, array $options) | 17 | public function buildForm(FormBuilderInterface $builder, array $options) |
13 | { | 18 | { |
14 | $builder | 19 | $builder |
15 | ->add('username', 'text', array('required' => true)) | 20 | ->add('username', TextType::class, array('required' => true)) |
16 | ->add('plainPassword', 'repeated', array( | 21 | ->add('plainPassword', RepeatedType::class, array( |
17 | 'type' => 'password', | 22 | 'type' => PasswordType::class, |
18 | 'constraints' => array( | 23 | 'constraints' => array( |
19 | new Constraints\Length(array( | 24 | new Constraints\Length(array( |
20 | 'min' => 8, | 25 | 'min' => 8, |
@@ -23,8 +28,8 @@ class NewUserType extends AbstractType | |||
23 | new Constraints\NotBlank(), | 28 | new Constraints\NotBlank(), |
24 | ), | 29 | ), |
25 | )) | 30 | )) |
26 | ->add('email', 'email') | 31 | ->add('email', EmailType::class) |
27 | ->add('save', 'submit') | 32 | ->add('save', SubmitType::class) |
28 | ; | 33 | ; |
29 | } | 34 | } |
30 | 35 | ||
@@ -35,7 +40,7 @@ class NewUserType extends AbstractType | |||
35 | )); | 40 | )); |
36 | } | 41 | } |
37 | 42 | ||
38 | public function getName() | 43 | public function getBlockPrefix() |
39 | { | 44 | { |
40 | return 'new_user'; | 45 | return 'new_user'; |
41 | } | 46 | } |