我想将ActionColumn按钮视图的目标更改为同一数据库中的不同表格...
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
// 'id',
'nama_siswa',
'bahasa_indonesia',
'bahasa_inggris',
'matematika',
'kejuruan',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
答案 0 :(得分:0)
您可以将view
按钮网址更改为: - 指向另一个操作控制器或网址
将ActionColumn
装饰器更改为: -
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
// 'id',
'nama_siswa',
'bahasa_indonesia',
'bahasa_inggris',
'matematika',
'kejuruan',
[
'class' => 'yii\grid\ActionColumn',
'buttons' => [
'view' => function(){
return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', ['/other-controller/action'], []);
}
]
],
],
]); ?&GT;