pagination problem |
I'm using codeigniter 3 and using hmvc for admin but problem pagination no showing First a Last link.i could not understand where is the problem.Is it ci3 problem or my script problem
$config['per_page'] = 2; $config['base_url'] = base_url().'admin/manage-cms'; $config['num_links'] = 20; $config['uri_segment'] = 3; $page = $this->uri->segment(3); $limit_end = ($page * $config['per_page']) - $config['per_page']; if ($limit_end < 0){ $limit_end = 0; } $config['first_link'] = 'First'; $config['last_link'] = 'Last'; $data['count_cms']= $this->cms_model->count_cms(); $config['total_rows'] = $data['count_cms']; $data['cms'] = $this->cms_model->get_cms($config['per_page'],$limit_end); $this->pagination->initialize($config); i also updated the code to $config['per_page'] = 2; $config['base_url'] = base_url('admin/manage-cms'); $config['num_links'] = 20; $config['uri_segment'] = 3; $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0; $config['first_link'] = 'First'; $config['last_link'] = 'Last'; $data['count_cms']= $this->cms_model->count_cms(); $config['total_rows'] = $data['count_cms']; $data['cms'] = $this->cms_model->get_cms($config['per_page'],$page); $this->pagination->initialize($config); But following problem have found 1)in url, pagination coming like url/2,url/4,url/6 etc But i trying to show url/1,url/2,url/3 2) I have inserted 9 records in db but still First and Last link is not displayed |
Messages In This Thread |
pagination problem - by avijit.nanda07 - 08-17-2015, 11:07 AM
RE: pagination problem - by mwhitney - 08-18-2015, 06:50 AM
|