账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    Yii rule自定义错误信息没用
    58
    0
    public function rules()
        {
            return [
                [['pid', 'user_type', 'email_bind', 'mobile_bind', 'reg_ip', 'status'], 'integer'],
                [['create_time', 'update_time'], 'safe'],
                [['nickname', 'password', 'email'], 'string', 'max' => 3, 'message'=>'长度最大不超过3位'],
                [['username'], 'string', 'max' => 5, 'message' => '长度最大不超过5位'],
                [['mobile'], 'string', 'max' => 11],
                [['avatar'], 'string', 'max' => 255],
                [['reg_type'], 'string', 'max' => 15],
                [['username'], 'unique'],
            ];
        }

    使用getErrors()调用之后显示的依然是默认的英文格式:Password should contain at most 3 characters

    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部