AlexInt
(Alex)
1
I have this
$pags = new CPagination($count);
$pags->pageSize = 10;
$pags->applyLimit($criteria);
$pags->pageVar = 'pagina';
The URL is blog?pagina=2 and it doesn’t work, it stays on the first page. If I comment the pageVar line the URL is blog?page=2 and everything works.
Any ideas why it isn’t working?
gerhard
(gerhard@ecolar.co.za)
2
I use this to display the last page by default - after the dataprovider was created:
$pager = $dataProvider->pagination;
$pager->itemCount = $dataProvider->totalItemCount;
$pager->currentPage = $pager->pageCount;
Maybe you can change the last row to something like:
$pager->currentPage = Yii::app()->request->getParam('pagina', 1); // Default to page 1 if 'pagina' is not in url