2

Offset is not working- is it correct? The pagination doesn't work.

$query = Event::find()
            ->offset(4)
            ->groupBy("sort_today");

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);
aewawc4453
  • 51
  • 1
  • 5

1 Answers1

5

If you want to set offset manually you need to switch off the pagination.

$dataProvider = new ActiveDataProvider([
    'query' => $query,
    'pagination' => false
]);

Otherwise pagination resets offset to whatever page is current.

Bizley
  • 15,937
  • 5
  • 43
  • 53