Domanda

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?

È stato utile?

Soluzione

Set the zero-based currentPage attribute of the pagination

...
'pagination'=>array(
  'pageSize'=>2,
  'currentPage'=>1,
),
...
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top