我在模型中使用了这个查询来验证大写字母的等级
'grade' => array(
'ruleName' => array(
'rule' => '/^[A-Z]{1}$/i',
'message'=>'You must enter the code'
// extra keys like on, required, etc. go here...
),
'ruleName2' => array(
'rule'=> 'isUnique',
'on'=> 'create',
'message' => 'This grade is already taken. Please choose a different one.'
),
'ruleName3'=>array(
'rule'=>'notEmpty',
'message'=>'This field is required'
)
),
但它不起作用,就像我给一个小写字母而不是大写字母一样,它会进入数据库。所以请帮我解决这个问题..
提前致谢