Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const PAGE_SIZE=50;
  2.  
  3. // ... in the action ....
  4. $potentialListings = $store->getAgedStock($filters); // this returns an array of objects
  5.  
  6. $pages = new CPagination(count($potentialListings));
  7. $pages->pageSize =  self::PAGE_SIZE;
  8. if (isset($_GET['page'])) {
  9.     $pages->currentPage = $_GET['page'];
  10. } else {
  11.     $pages->currentPage = 0;
  12. }
  13.  
  14. $this->render('list',array(
  15.     'potentialListings'=>$potentialListings,
  16.     'store' => $store,
  17.     'filters' => $filters, // for use in the filter form
  18.     'pages' => $pages // for paginator
  19. ));
  20.  
  21.  
  22. // ... and in the view ...
  23. $this->widget('CLinkPager',array('pages' => $pages)); // this renders nothing at all
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement