Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Yii::$app->getSecurity()->generatePasswordHash($password);
$model = new User();
$model->emal = '[email protected]';
$model->setPassword(123456);
$model->save();
public function setPassword($password)
{
$this->password = Yii::$app->security->generatePasswordHash($password);
}
If it is yii1.x then php.net/manual/ru/function.password-hash.php using bcrypt.
If it is yii2.x, then there is already a built-in wrapper for this https://www.yiiframework.com/doc/api/2.0/yii-base-...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question