public function actions() { $actions = parent::actions(); $actions['index']['prepareDataProvider'] = function () { // Get id param $request = \Yii::$app->getRequest(); $id = $request->get('id'); $query = FormRule::find()->where('form_id=:form_id', [':form_id' => $id]); return new ActiveDataProvider(['query' => $query]); }; return $actions; }