Pagination Not working for me |
[eluser]Arockia Raj[/eluser]
Hi, I am new to CI. I tried Pagination but i can't. Plz any one help me. My controller code $this->load->library('pagination'); $per_page=3; $config['base_url'] = base_url().'index.php/product/viewProduct/'; $config['total_rows'] = 9; $config['per_page'] = 3; $config['uri_segment'] = 3; $config['num_links'] = 2; $config['page_query_string'] = TRUE; $config['first_link'] = 'First'; $config['last_link'] = 'Last'; $config['full_tag_open'] = '<p>'; $config['full_tag_close'] = '</p>'; $this->outputData['products'] = $this->user_model->getProducts($per_page, $this->uri->segment(3)); $this->pagination->initialize($config); View code <? echo $this->pagination->create_links(); ?> If i tried the above code, in the browser i get the links like 1 2 3 > if i click on 2 it redirect to the page http://localhost/pricebuster/index.php/p...per_page=3 . but in this page there is no link for 1. Also it showing same records as like page1. Same problem for link 3. Thanks in advance. Regards, Raj
[eluser]pickupman[/eluser]
Try removing this line: Code: $config['page_query_string'] = TRUE; Note: When posting code on the boards, please use the code button to wrap the code. This will help with syntax highlighting.
[eluser]Arockia Raj[/eluser]
Hi, Thank you for you reply. But still the same problem exist. Plz help any one to solve this issue Arockia Raj
[eluser]pickupman[/eluser]
How about Code: $config['base_url'] = site_url('product/viewProduct/'); |
Welcome Guest, Not a member yet? Register Sign In |