Implementing a password validator for zf2

What is a good approach for writing passwords that checks two inputs (should be equal to eqeal) and how you can integrate this into zf2 form.

+4
source share
1 answer

There is an โ€œIdenticalโ€ validator that checks equal two fields, it can be used as follows in the form constructor:

$this->add(array( 'name' => 'password', // add first password field /* ... other params ... */ )); $this->add(array( 'name' => 'passwordCheck', // add second password field /* ... other params ... */ 'validators' => array( array( 'name' => 'Identical', 'options' => array( 'token' => 'password', // name of first password field ), ), ), )); 
+31
source

Source: https://habr.com/ru/post/1447257/


All Articles