public function item($items,$name){
$returnValue='';
foreach($items as $n=>$item){
if(isset($this->$name)){
if($n==$this->$name){
$returnValue=$item;
}
}
}
return $returnValue;
}
view里:
array('name'=>'isPass','value'=>'$data->item(array(\'1\'=>\'是\',\'0\'=>\'否\'),\'isProcess\')','filter'=>array('1'=>'是','0'=>'否')),
更简单些
'value'=> '$data->ispass == "1" ? "是" : "否"',