I've created this CActiveDataProvider:

  $dataProvider=new CActiveDataProvider('Post',array(
    'criteria'=>array(
      'condition'=>$condition,
      'params'=>$params,
    ),
    'pagination'=>array(
      'pageSize'=>2,
    ),
  ));

but ... How can I define current page and load records 3,4 instead of 1,2? How can I get a precise page?

有帮助吗?

解决方案

Set the zero-based currentPage attribute of the pagination

...
'pagination'=>array(
  'pageSize'=>2,
  'currentPage'=>1,
),
...
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top