models/LoginMethod/ID.php
public static function validate($attribute)
    {
        $userClass = Yii::$app->user->identityClass;
        $regex = $userClass::$idRegex;
        $result = preg_match($regex, $attribute);
        return is_int($result) && $result > 0;
    }
public static function validate($attribute)
    {
        $userClass = Yii::$app->user->identityClass;
        $regex = $userClass::$idRegex;
        $result = preg_match($regex, $attribute);
        return is_int($result) && $result > 0;
    }
public static function validate ( $ attribute ) { $ userClass = Yii :: $ app -> user -> identityClass ; $ regex = $ userClass :: $ idRegex ; $ result = preg_match ( $ regex , $ attribute ) ; return is_int ( $ result ) && $ result > 0 ; }
Validate whether the attribute is valid.
@param mixed $attribute
@return bool
Validate whether the attribute is valid .