I am trying to encrypt a password using the PHP crypt function. In yii, it's recommended to use CPasswordHelper. When I call CPasswordHelper::hashPassword($password), it says Class 'common\models\CPasswordHelper' not found.
Please help?
I am trying to encrypt a password using the PHP crypt function. In yii, it's recommended to use CPasswordHelper. When I call CPasswordHelper::hashPassword($password), it says Class 'common\models\CPasswordHelper' not found.
Please help?
To generate hashed password in Yii 2 use
security
component.You can generate password hash with:
To validate this password later on you can check:
Read more about this in the Guide.