Welcome Guest, Not a member yet? Register   Sign In
pagination problem
#1

[eluser]Unknown[/eluser]
Hello , i am trying to make a pagination links for records which fetched from database .
----------------------------
my Controller path is :http://localhost/databox/index.php/adminme/news
and here i got all my records in one table , but when clicking on page 2, i should redirected to http://localhost/databox/index.php/adminme/news/10
Then i get 404 Page Not Found!!

News Controler
================
Code:
function index()
    {
     $this->load->library('pagination');
  $this->load->model('adminme/news_model');
  $config['base_url'] = base_url().'index.php/adminme/news';
  $config['total_rows'] = $this->news_model->record_count();
  $config['per_page'] = 10;
  $config['uri_segment'] = 3;
  $choice = $config['total_rows']/$config['per_page'];
  $config['num_links'] = round($choice);

  $this->pagination->initialize($config);
  
  $page = ($this->uri->segment(3))? $this->uri->segment(3) : 0;
  $data['results'] = $this->news_model->get_records($config['per_page'],$page);
  $data['links'] = $this->pagination->create_links();
  $this->load->vars($data); //to make the $data varible public to news view
  $content['main_content'] = 'adminme/news';
  $this->load->view('adminme/includes/template',$content);

My View links code
==================
Code:
<p>&lt;?=$links?&gt;</p>

Can anybody help me on this !!




Theme © iAndrew 2016 - Forum software by © MyBB