我试图进行查询以获取前10条记录,并将其传递给ActiveDataProvider
.
查询工作正常,只返回所需数量的记录,而ActiveDataProvider
打印所有记录,这是我的代码:
$query = new \yii\db\Query; $query->select('*') ->from('customers') ->limit(10); $query->createCommand(); $dataProvider = new ActiveDataProvider([ 'query' => $query, ]);
Insane Skull.. 6
设置Pagination
为false
:
$dataProvider = new ActiveDataProvider([ 'pagination' => false ]);
参考
设置Pagination
为false
:
$dataProvider = new ActiveDataProvider([ 'pagination' => false ]);
参考