Welcome
I wrote a script that shows articles. I added to it pagination.
However, I have one question: whether it is something to do with the parameters for subsequent pages.
Current URL:
localhost/articles/art/1?page=1&per-page=10
So as have a look after the change
localhost/articles/art/1/1/10
The controller use
$dataProvider = new ActiveDataProvider([
'query' => AppPages::find()->where(['category_id' => $_GET['id']] ->orderby('page_id DESC'),
'pagination' => [
'pageSize' => 10,
]
]);
$PageContent = $dataProvider->getModels();
While in view of:
echo LinkPager :: widget ([
'pagination' => $dataProvider->pagination,
]);