$model, 'attributes' => [ 'name', 'tips', [ 'attribute' => 'img', 'format' => 'raw', 'value' => function($model){ if( empty($model->img) ) return ''; return ""; } ], [ 'attribute' => 'target', 'value' => function($model){ return Constants::getTargetOpenMethod($model->target); } ], 'link', 'sort', [ 'attribute' => 'status', 'value' => function($model){ return Constants::getStatusItems($model->status); } ], 'desc', ], ]);