helpers/Password.php
public static function hash($password)
    {
        return \Yii::$app->security->generatePasswordHash($password, \Yii::$app->getModule('user')->cost);
    }
public static function hash($password)
    {
        return \Yii::$app->security->generatePasswordHash($password, \Yii::$app->getModule('user')->cost);
    }
Wrapper for yii security helper method.

@param $password
@return string