wordpress定制,站长之家seo综合,巴城镇建设网站,厦门网直播2019独角兽企业重金招聘Python工程师标准 Rules验证规则#xff1a;required : 必须值验证属性||CRequiredValidator 的别名, 确保了特性不为空.[[字段名],required,requiredValue必填值,message提示信息];email : 邮箱验证||CEmailValidator 的别名,确… 2019独角兽企业重金招聘Python工程师标准 Rules验证规则required : 必须值验证属性||CRequiredValidator 的别名, 确保了特性不为空.[[字段名],required,requiredValue必填值,message提示信息];email : 邮箱验证||CEmailValidator 的别名,确保了特性的值是一个有效的电邮地址.[email, email];match : 正则验证||CRegularExpressionValidator 的别名, 确保了特性匹配一个正则表达式.[[字段名],match,pattern正则表达式,message提示信息];
[[字段名],match,notture,pattern正则表达式,message提示信息]; /*正则取反*/url : 网址||CUrlValidator 的别名, 确保了特性是一个有效的路径.[website, url, defaultScheme http];
captcha验证码||CCaptchaValidator 的别名,确保了特性的值等于 CAPTCHA 显示出来的验证码.[verificationCode, captcha];
safe : 安全[description, safe];
compare :(比较) CCompareValidator 的别名, 确保了特性的值等于另一个特性或常量.[password, compare]
//compareValue:比较常量值 operator:比较操作符
[age, compare, compareValue 30, operator ]; //age必须大于等于30 否则给出提示[[wallet_share_price],compare, compareAttribute wallet_price, operator ,message分享者的金额必须小于等于限定金额],[[wallet_shares_price],compare, compareAttribute wallet_price, operator ,message被分享者的金额必须小于等于限定金额], //两个属性之间进行比较filter 过滤 [[username, email], filter, filter trim, skipOnArray true], //不是过滤空格 是过滤 sql注入default : 默认值||CDefaultValueValidator 的别名, 为特性指派了一个默认值.[age, default, value null];[[wallet_price], default, value 1], 设置默认值exist : 存在||CExistValidator 的别名, 确保属性值存在于指定的数据表字段中.[字段名, exist];file : 文件||CFileValidator 的别名, 确保了特性包含了一个上传文件的名称.[primaryImage, file, extensions [png, jpg, gif], maxSize 1024*1024*1024]filter : 滤镜||CFilterValidator 的别名, 使用一个filter转换属性.[[username, email], filter, filter trim, skipOnArray true];in : 范围||CRangeValidator 的别名, 确保了特性出现在一个预订的值列表里.[level, in, range [1, 2, 3]];unique : 唯一性||CUniqueValidator 的别名, 确保了特性在数据表字段中是唯一的.[字段名, unique][[wallet_name], unique], //在wallet_name 这一列是唯一的[[wallet_name], unique, targetAttribute wallet_price], // 在目标属性 wallet_price 这一列是唯一的 不在wallet_name 这一列integer : 整数[age, integer];number : 数字[salary, number];double : 双精度浮点型[salary, double];date : (日期)[[from, to], date];string : 字符串[username, string, length [4, 24]];boolean : 是否为一个布尔值||CBooleanValidator 的别名[字段名, boolean, trueValue true, falseValue false, strict true];image :是否为有效的图片文件[primaryImage, image, extensions png, jpg, minWidth 100, maxWidth 1000, minHeight 100, maxHeight 1000]trim 去除 两端的空白符;
[[username, email], trim], 转载于:https://my.oschina.net/botkenni/blog/884186