2 namespace Wallabag\CoreBundle\Form\Type
;
4 use Symfony\Component\Form\AbstractType
;
5 use Symfony\Component\Form\FormBuilderInterface
;
6 use Symfony\Component\OptionsResolver\OptionsResolverInterface
;
7 use Symfony\Component\Validator\Constraints
;
9 class NewUserType
extends AbstractType
11 public function buildForm(FormBuilderInterface
$builder, array $options)
14 ->add('username', 'text')
15 ->add('password', 'password', array(
16 'constraints' => array(
17 new Constraints\
Length(array(
19 'minMessage' => 'Password should by at least 8 chars long',
21 new Constraints\
NotBlank(),
24 ->add('email', 'text')
25 ->add('save', 'submit')
29 public function setDefaultOptions(OptionsResolverInterface
$resolver)
31 $resolver->setDefaults(array(
32 'data_class' => 'Wallabag\CoreBundle\Entity\User',
36 public function getName()