2016-07-07 6 views

Antwort

0

können Sie Zugriff check() wie diese nicht beacause es eine geschützte Methode ist

für weitere Informationen siehe: http://api.cakephp.org/3.0/class-Cake.Validation.Validation.html

Sie nicht versuchen, etwas wie unten:

public function validate_passwords() { 
    return array('check' => array($this->data[$this->alias]['confirm_password'], $this->data[$this->alias]['password'])); 

}

zu validate confirm_password mit Passwort diese Regel hinzufügen:

$validator->add('confirm_password', 'no-misspelling', [ 
    'rule' => ['compareWith', 'password'], 
    'message' => 'Passwords are not equal', 
]); 
0

Sie dies

public function validate_passwords() 
{ 
    return $this->data[$this->alias]['password'] === $this->data[$this->alias]['confirm_password']; 
} 

seine Arbeit für Sie mit dem Kennwort für validate confirm_password verwenden.