视图层 表格里面的 的超链接

<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>

posted on 2018-09-21 11:32  刷哥  阅读(125)  评论(0编辑  收藏  举报

导航