jeudi 18 mai 2017

Yii2 - Bulk checkbox by GET request

I have a checkbox in a gridview Yii2 like this,

[
    'class' => 'kartik\grid\CheckboxColumn',
    'width' => '20px',
    'checkboxOptions' => function ($model, $key, $index, $column) {
        return [
            'value' => trim($model->vessel),
        ];
    }

],

Then to get all the value checkbox in yii2, I use this button

Html::a('<i class="glyphicon glyphicon-print"></i>&nbsp; Print All',
                        ["print-all-based-date"],
                        [
                            "class" => "btn btn-success",
                            'role' => 'modal-remote-bulk',

                        ])

But when in my controller that handle the the action,

public function actionPrintAllBasedTanggal()
{
    $request = Yii::$app->request;
    $get = $request->get();
    print_r($get);
    die();

I get :

Array
(
   [r] => iwwi/incoming/print-all-based-tanggal
   [KMTC_HOCHIMINH,OOCL_NAGOYA] => 
   [_] => 1495123320863
)

What it means [KMTC_HOCHIMINH,OOCL_NAGOYA] =>,

I check in html, the checkbox is named selection[] ?

I need this : KMTC_HOCHIMINH,OOCL_NAGOYA to get continue my app. Please advise.

Thanks




Aucun commentaire:

Enregistrer un commentaire