]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/CoreBundle/Form/Type/ResetPasswordType.php
CS
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Form / Type / ResetPasswordType.php
1 <?php
2
3 namespace Wallabag\CoreBundle\Form\Type;
4
5 use Symfony\Component\Form\AbstractType;
6 use Symfony\Component\Form\FormBuilderInterface;
7 use Symfony\Component\Validator\Constraints;
8
9 class ResetPasswordType extends AbstractType
10 {
11 public function buildForm(FormBuilderInterface $builder, array $options)
12 {
13 $builder
14 ->add('new_password', 'repeated', array(
15 'type' => 'password',
16 'invalid_message' => 'The password fields must match.',
17 'required' => true,
18 'first_options' => array('label' => 'New password'),
19 'second_options' => array('label' => 'Repeat new password'),
20 'constraints' => array(
21 new Constraints\Length(array(
22 'min' => 8,
23 'minMessage' => 'Password should by at least 8 chars long',
24 )),
25 new Constraints\NotBlank(),
26 ),
27 ))
28 ;
29 }
30
31 public function getName()
32 {
33 return 'change_passwd';
34 }
35 }