CakePHP 3 DefaultPasswordHasher
问题 I am working on creating an authentication form that has a password and password_again field in it. So I can check to make sure they match, I am using the beforeSave() function of my UsersTable to take care of the hashing. As a test, I have just set it to show me the password_again, its hashed result and then die. public function beforeSave($event, $entity){ debug($entity->password_again); $hasher = new DefaultPasswordHasher(); $entity->password_again = $hasher->hash($entity->password_again);