How to send parameter with submitButton

Hi guys,

If I want to send parameter using link in anonymous function,I code like this:





      [

            'class' => 'yii\grid\ActionColumn',

            'template' => '{anlagen_index}<br><br>{anlagen_create}',

            'buttons' => [

                'anlagen_index' => function ($model, $id) {

                    return Html::a('<span class="glyphicon glyphicon-paperclip"></span>', ['/dateianhang/dateianhang/index', 'id' => $id->id_person], ['title' => 'Anlagen anzeigen', 'data' => ['pjax' => '0']]);

                },



In Controller, I code like this:





    public function actionIndex($id) {

.

.

    }



How to implement same thing with submittButton?

Got it by my own:

in GridView I code like this:




 <?= Html::submitButton('<span class="glyphicon glyphicon-trash"></span>',['title'=>'Records löschen','name' => 'button_cb']); ?>   



In Controller like this





    public function actionDelete_records() {

        $checkbox = (array) Yii::$app->request->post('selection');

        if (empty(($checkbox))&&(isset($_POST['button_cb']))) {

.

.

}