From e4977b8a866f84f65f08c55c050a62f40170fdbf Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sun, 22 Feb 2015 09:30:25 +0100 Subject: Adding new user --- src/Wallabag/CoreBundle/Form/Type/NewUserType.php | 40 +++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/Wallabag/CoreBundle/Form/Type/NewUserType.php (limited to 'src/Wallabag/CoreBundle/Form/Type/NewUserType.php') diff --git a/src/Wallabag/CoreBundle/Form/Type/NewUserType.php b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php new file mode 100644 index 00000000..313a9aae --- /dev/null +++ b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php @@ -0,0 +1,40 @@ +add('username', 'text') + ->add('password', 'password', array( + 'constraints' => array( + new Constraints\Length(array( + 'min' => 8, + 'minMessage' => 'Password should by at least 8 chars long', + )), + new Constraints\NotBlank(), + ), + )) + ->add('email', 'text') + ->add('save', 'submit') + ; + } + + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + 'data_class' => 'Wallabag\CoreBundle\Entity\User', + )); + } + + public function getName() + { + return 'new_user'; + } +} -- cgit v1.2.3