Answer the question
In order to leave comments, you need to log in
How to display pagination in LinkPager via dataProvider?
Good day! From the controller I get a variable with the following content:
$query = House::find()->andFilterWhere(['wall' => $modelHouse->wall, 'city' => $modelHouse->city])
->andFilterWhere(['between', 'price', $modelHouse->priceFrom, $modelHouse->priceTo])
->andFilterWhere(['between', 'area', $modelHouse->areaFrom, $modelHouse->areaTo])
->andFilterWhere(['room' => $modelHouse->room,]);
$dataProvider = new \yii\data\ActiveDataProvider([
'query' => $query,
'pagination' => [
'pageSize' => 3,
],
]);
<?php \yii\widgets\LinkPager::begin([
'pagination' => (СЮДА),
]) ?>
Answer the question
In order to leave comments, you need to log in
Good evening.
For example, pass the parameter pageSize => 5
Will display five records per page
ps More details here
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question