i did custom pagination using in Yii. i have 33 items. but yii pagination not working for that last 3 items.
Sample Code:
$total = 33;
$pages =new CPagination($total);
$pages->setPageSize($this->pagesize);
$pages->setCurrentPage($page);
$start = ($pages->currentPage-1)*$pages->pageSize;
$images = array_slice($images,$start,($pages->pageSize));
Here is your code
$total = 33;
$pages =new CPagination($total);
$pages->setPageSize($this->pagesize); // $this->pagesize = 10
$start = $pages->currentPage * $pages->pageSize;
$images = array_slice($images,$start,($pages->pageSize));
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.