我想问一下如何从gridview检索数据作为数组 如本主题所述 How can I get the selected data/item rows in CheckboxColumn Gridview - Yii2
我一直在做的是: 在控制器中
RcppArmadillo
视图中:
public function actionCetakdispo{
$action=Yii::$app->request->post('action');
$selection=(array)Yii::$app->request->post('selection');
print_r($selection);
exit;
}
但是没有数据检索到数组..请给我上课或参考以阅读..非常感谢..
已更新: 我改变观点变得像这样:
<?=Html::beginForm(['controller/rekapsm'],'post');?>
<?= Html::a('Cetak Dispo', ['cetakdispo'], ['class' => 'btn btn-
primary']) ?>
<?= Html::a('Cetak Register', ['cetakreg'], ['class' => 'btn btn-
primary']) ?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id',
'kategori',
'nama_wp',
'nama',
'nomor_surat',
'tgl_surat',
'perihal',
'ket',
['class' => 'yii\grid\CheckboxColumn'],
],
]); ?>
及其作品...