时间:2021-07-01 10:21:17 帮助过:10人阅读
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" ? "是" : "否"',