Advertisement
Guest User

Controller

a guest
Apr 29th, 2014
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.83 KB | None | 0 0
  1. //Controller
  2.  
  3. $limit = 15;
  4. $offset=$this->uri->segment(4);
  5. if($offset=='')
  6. $offset=0; //pagination class needs to know what page we are on
  7. $config['total_rows'] = $this->Information->CountTopRated($type); //do a quick db lookup to see how many records we are dealing with
  8. $config['base_url'] = site_url('/catagory/androidTopRated/'.$type.'/'); //our URI segments are built from the site address, posts controller and the index method. 
  9. $config['per_page'] = $limit;//using our limit variable to set the number of records to display
  10.  
  11. $data['tr'] = $this->Information->topRated($type,$limit,$offset);//chaining active record methods from our MY_Model to limit and get all records   
  12. $config['uri_segment']   = 4;  
  13. $kk = $this->pagination->frontpaginationstyle();
  14.  
  15. $config = array_merge($kk,$config);
  16. $this->pagination->initialize($config);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement