Model's function for which I got this error:
public function setPassword($password)
{
$this->password_hash = Yii::$app->security->generatePasswordHash($password);
}
public function generateAuthKey()
{
$this->auth_key = Yii::$app->security->generateRandomString();
}
Add
use Yii;
Before your class declaration.
Or add a backslash in front of the Yii word.
$this->password_hash = \Yii::$app-> ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With