http://www.thinkphp.cn/api/source-class-Model.html#975
protected?function?_validationFieldItem($data,$val)?{
switch(strtolower(trim($val[4])))?{
case?'function'://?使用函數進行驗證
case?'callback'://?調用方法進行驗證
$args?=?isset($val[6])?(array)$val[6]:array();
if(is_string($val[0])?&&?strpos($val[0],?','))
$val[0]?=?explode(',',?$val[0]);
if(is_array($val[0])){
//?支持多個字段驗證
foreach($val[0]?as?$field)
$_data[$field]?=?$data[$field];
array_unshift($args,?$_data);
}else{
array_unshift($args,?$data[$val[0]]);
}
if('function'==$val[4])?{
return?call_user_func_array($val[1],?$args);
}else{
return?call_user_func_array(array(&$this,?$val[1]),?$args);
}