Сортировка в dataProvider

PHP
  1. $dataProvider = new ActiveDataProvider([
  2. 'query' => $query,
  3. 'sort'=> ['defaultOrder' => ['topic_order'=>SORT_ASC]]
  4. ]);

или

PHP
  1. $dataProvider->setSort([
  2. 'defaultOrder' => ['topic_order'=>SORT_DESC],
  3. 'attributes' => [...]
  4. ]);



Офф. документация

    Комментарии