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