daily pastebin goal
65%
SHARE
TWEET

Untitled

a guest Jul 17th, 2017 55 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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top