Password Confirmation in zend framework

后端 未结 5 646
萌比男神i
萌比男神i 2021-01-03 04:32

I add this class to library/My/Validate/PasswordConfirmation.php



        
5条回答
  •  被撕碎了的回忆
    2021-01-03 04:41

    A less elegant and simpler way to do it:

        $password = new Zend_Form_Element_Password('password');
        $password->setLabel('Password:')
                ->addValidator('StringLength', false, array(6,24))
                ->setLabel('Choose your password:')
                ->setRequired(true);
    
        $password2 = new Zend_Form_Element_Password('password-confirm');
        $password2->setLabel('Confirm:')
                ->addValidator('StringLength', false, array(6,24))
                ->setLabel('Confirm your password:')
                ->addValidator(new Zend_Validate_Identical($_POST['password']))
                ->setRequired(true);
    

提交回复
热议问题