视图层 表格里面的 的超链接
<div class="col-sm-12">
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' =>[
[
'class' => 'yii\grid\ActionColumn', //必须
'header' => '操作', //名字可以随便换
'template' => '{detail}', //必须
'buttons' => [
'detail' => function ($url,$model,$key) { //这里三个参数,必须,如果只写一个$model,会提示 Trying to get property of non-object
if ($model->is_return)
return Html::a('详情', 'group/order/detail?id=' . $model->id);
else
return '\\';
}
]
],
]
]};
</div>