Hi guys, in my Controller, I have following public method
public function actionIndex($searchparam = NULL) { if (isset($_SESSION['fk'])) { unset($_SESSION['fk']); } if (isset($_SESSION['adressen'])) { unset($_SESSION['adressen']); } if (isset($_SESSION['name'])) { unset($_SESSION['name']); } if (isset($_SESSION['geschlecht'])) { unset($_SESSION['geschlecht']); } $searchModel = new MailAusgangSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); }
I want to call this method by another module,which will send, repsectively give any parameter. Apending from this given parameter, GridView should show display records, selected by searchmodel.For instance, I call method like this:
[ 'class' => 'yii\grid\ActionColumn', 'template' => '{mail_index}', 'buttons' => [ 'mail_index' => function ($model, $id) { return Html::a('<span class="glyphicon glyphicon-paperclip"></span>', ['/mail/mail-eingang/index', 'id' => $model->id_person], ['title' => 'Mail anzeigen', 'data' => ['pjax' => '0']]); }, ], ],
Now, GridView of mail/mail-eingang/index should display records depending on id_person.Any ideas how to call searchmodel with parameter given by another module?