Pagination |
[eluser]praveena[/eluser]
HI I am creating a pagiantion for my page I have a problem I was not able to create a link for second page this is my code CONTROLLER CODE function index($row=0) { $this->load->model('page_model'); $this->load->library('pagination'); $config['base_url']='base_url()'; $config['total_rows']=$this->page_model->studentcount(); $config['per_page']='3'; $this->pagination->initialize($config); $data['title']='Displaying Student List'; $data['list']=$this->page_model->getstudents(); $data['header']='Student List'; $data['links']=$this->pagination->create_links(); //$mem['list']=$this->page_model->getstudents(); $this->load->view('page_viewall',$data); } ********************************************************************************* Pls help me
[eluser]InsiteFX[/eluser]
Code: function index($row = 0) Read the CodeIgniter User Guide! Pagination Class InsiteFX
[eluser]Federico BaƱa[/eluser]
your "getstudents" method should have a parameter to indicate the page you're loading, like this: Code: $page = $this->uri->segment(3); // get the page from the query string (url) and your query could be like: Code: public function getstudents($page) |
Welcome Guest, Not a member yet? Register Sign In |