Pages

Sunday, June 9, 2013

Cakephp/PHP-Maintaing Pagination id's in sequance for each page

 Cakephp/PHP-Logic,Setting Pagination id's in sequance

 $paginationdata=$this->Paginator->params();  
 $currentpage=$this->Paginator->current();  
 foreach($data as ($key=>$value))  
 {  
   echo ($paginationdata['limit']*($currentPage-1))+$key+1;  
 }  
Now for any page id's will start according to selected page for example for first page on a limit 5...1,2,3,4,5 on second page limit 5.....6,7,8,9.10

No comments:

Post a Comment