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