joinWith('lang'); $dataProvider = new ActiveDataProvider( [ 'query' => $query, 'sort' => false, ] ); $this->load($params); /*if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; }*/ // grid filtering conditions $query->andFilterWhere( [ 'category.id' => $this->id, ] ) ->andFilterWhere( [ 'ilike', 'category_lang.title', $this->categoryName, ] ); $query->orderBy( [ 'category.path' => SORT_ASC, 'category.depth' => SORT_ASC, 'category.id' => SORT_ASC, ] ); return $dataProvider; } }