regmach
- regmach 回复了话题 关于YII2中的 GridView
外部创建一个数组
$typeList = ['1' => '待审核', '2' => '已审核', '3' => '未通过',
];
在gridView的columns中:
[ 'attribute' => 'type', 'value' => function($data) { return $typeList[$data->type]; }, ],
外部创建一个数组
$typeList = [
'1' => '待审核',
'2' => '已审核',
'3' => '未通过',
];
在gridView的columns中:
[
'attribute' => 'type',
'value' => function($data) {
return $typeList[$data->type];
},
],