Reputation: 2499
What is the right way to have variable pagination in Yii2? I mean by this, that I want the user to be able to give the number of items in a page while sending an API request.
I know about setting the pageSize
in the dataProvider
.
$dataProvider = new SqlDataProvider([
'sql' => 'SELECT * FROM user WHERE status=:status',
'params' => [':status' => 1],
'pagination' => [
'pageSize' => 20,
],
]);
But my question is about anything that is built in that allows the user to send the pageSize through the request? Is there anything built-in to perform this function?
Upvotes: 0
Views: 1084