Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 710 Bytes

ConfirmPassword.md

File metadata and controls

23 lines (19 loc) · 710 Bytes

ConfirmPassword

This is a special constraint for ConfirmedPasswordField, so you can add separate constraints on the PasswordField and ConfirmPasswordField, and also will automatically make sure the ConfirmPasswordField has the same value as PasswordField.

Usage


    $validator = ZenValidator::create();
    $validator->setConstraint(
      $field, 
      new \Milkyway\SS\ZenForms\Constraints\ConfirmPassword([
        'PasswordField' => [
           new Constraint_required(),
           new \Milkyway\SS\ZenForms\Constraints\ValidPassword(Member::password_validator()),
        ],
        'ConfirmedPasswordField' => [
          new Constraint_required(),
        ],
      ])
    );