yii2 generate password code example Example: hashing passwords in yii 1 $hash = Yii::$app->getSecurity()->generatePasswordHash($password);