diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Form/Type/NewUserType.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Form/Type/NewUserType.php | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/Wallabag/CoreBundle/Form/Type/NewUserType.php b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php index 6eb0e63f..60fcc20c 100644 --- a/src/Wallabag/CoreBundle/Form/Type/NewUserType.php +++ b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php | |||
@@ -17,22 +17,30 @@ class NewUserType extends AbstractType | |||
17 | public function buildForm(FormBuilderInterface $builder, array $options) | 17 | public function buildForm(FormBuilderInterface $builder, array $options) |
18 | { | 18 | { |
19 | $builder | 19 | $builder |
20 | ->add('username', TextType::class, array('required' => true)) | 20 | ->add('username', TextType::class, array( |
21 | 'required' => true, | ||
22 | 'label' => 'config.form_new_user.username_label', | ||
23 | )) | ||
21 | ->add('plainPassword', RepeatedType::class, array( | 24 | ->add('plainPassword', RepeatedType::class, array( |
22 | 'type' => PasswordType::class, | 25 | 'type' => PasswordType::class, |
23 | 'invalid_message' => 'The password fields must match', | 26 | 'invalid_message' => 'validator.password_must_match', |
24 | 'first_options' => array('label' => 'Password'), | 27 | 'first_options' => array('label' => 'config.form_new_user.password_label'), |
25 | 'second_options' => array('label' => 'Repeat new password'), | 28 | 'second_options' => array('label' => 'config.form_new_user.repeat_new_password_label'), |
26 | 'constraints' => array( | 29 | 'constraints' => array( |
27 | new Constraints\Length(array( | 30 | new Constraints\Length(array( |
28 | 'min' => 8, | 31 | 'min' => 8, |
29 | 'minMessage' => 'Password should by at least 8 chars long', | 32 | 'minMessage' => 'validator.password_too_short', |
30 | )), | 33 | )), |
31 | new Constraints\NotBlank(), | 34 | new Constraints\NotBlank(), |
32 | ), | 35 | ), |
36 | 'label' => 'config.form_new_user.plain_password_label', | ||
37 | )) | ||
38 | ->add('email', EmailType::class, array( | ||
39 | 'label' => 'config.form_new_user.email_label', | ||
40 | )) | ||
41 | ->add('save', SubmitType::class, array( | ||
42 | 'label' => 'config.form.save', | ||
33 | )) | 43 | )) |
34 | ->add('email', EmailType::class) | ||
35 | ->add('save', SubmitType::class) | ||
36 | ; | 44 | ; |
37 | } | 45 | } |
38 | 46 | ||