I am trying to paginate using CodeIgniter, it should be so simple according to the Codeigniter manual, even in this example it looks like
"First <1 2 3 4 5> Last"
$config['total_rows'] = $this->searchdesc_model->queryallrows(); $config['per_page'] = '10'; $config['uri_segment'] =4; $config['full_tag_open'] = '<p>'; $config['full_tag_close'] = '</p>'; $config['cur_tag_open'] = '<b>'; $config['cur_tag_close'] = '</b>'; $config['first_link'] = 'First'; $config['last_link'] = 'Last'; $config['last_tag_open'] = '<p>'; $config['last_tag_close'] = '</p>' $this->load->library('Company_Creation');
in the view, I call it only as pagination-> create_links () ;? > (or I send it through the view when I call it from the controller, yet I only get this
1 2 3>
and there is no way to make it look like exmaple, it may seem so fictitious, but can someone help me? or is the problem similar?
thanks
EDIT 1
$config['total_rows'] = $this->searchdesc_model->queryallrows(); $config['per_page'] = '5'; $config['uri_segment'] =4; $config['full_tag_open'] = '<p>'; $config['full_tag_close'] = '</p>'; $config['cur_tag_open'] = '<b>'; $config['cur_tag_close'] = '</b>'; $config['first_link'] = ' First'; $config['last_link'] = ' Last'; $config['last_tag_open'] = '<p>'; $config['last_tag_close'] = '</p>'; $config['next_link'] = ''; $config['next_tag_open'] = '<p id="nextbutton" style="padding-left:5px;">'; $config['next_tag_close'] = '</p>'; $config['prev_link'] = ''; $config['prev_tag_open'] = '<p id="prevbutton" style="padding-right:5px;">'; $config['prev_tag_close'] = '</p>'; $config['num_links']=4; $data['retorno'] = $this->searchdesc_model->queryalldb($config['per_page'],$this->uri->segment(4,0)); $config['total_rows']=1000; $this->pagination->initialize($config);
I did this in accordance with some tips that I get, as you said, when a lot of data works well, but I LOVE to show the first and next button all the time, I set total_rows after my request (which I call with the right number of rows) and I also tried, and the results are the same, I also need to show only 4 numbers, and I use numb_links ... still not working (I donβt know why Ci docs say this should work ..) any idea?
Thanks!
source share