I use ActiveController as written in the documentation.
public function actionIndex() { $modelClass = $this->modelClass; $developer = Developers::findOne([ 'id' => Yii::$app->request->get('developer_id'), ]); $complex_type = ComplexType::findOne([ 'id' => Yii::$app->request->get('complex_id'), ]); $complex = Complex::findOne([ 'type_id' => $complex_type->id, 'developer_id' => $developer->id, ]); $query = $modelClass::find() ->where( [ 'amount_room' => Yii::$app->request->get('amount_room'), 'yardage' => Yii::$app->request->get('yardage'), 'level' => Yii::$app->request->get('level'), 'complex_id' => $complex->id, ]); return new ActiveDataProvider([ 'query' => $query, ]); } The question is as follows: Now it is necessary to transfer all the parameters, which is logical in principle. What is the way to make a check for the parameter fullness, and already depending on it do the search? I can do a bunch of ifs, but it’s not very nice. How best to implement this?