I am using ActiveDataProvider to return paginated results which mostly works fine. But when if there are (for example) 5 pages and the request asks for any pages above 5, the result set is page 5 when I would expect no records at all.
Is this expected behaviour? If not what can I try to fix it?
Example code:
return new \yii\data\ActiveDataProvider([
'query' => $query,
'pagination' => [
'pageSize' => $perPage,
],
]);