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