Question : yii2 active data provider
Answered by : nutty-narwhal-xpaxojtg3g20
$provider = new ActiveDataProvider([ 'query' => Post::find(), 'pagination' => [ 'pageSize' => 20, ],
]);
// get the posts in the current page
$posts = $provider->getModels();
Source : https://www.yiiframework.com/doc/api/2.0/yii-data-activedataprovider | Last Update : Thu, 21 Jul 22