Welcome Guest, Not a member yet? Register   Sign In
Home page pagination not working
#1

Hello, I'm having a little trouble, indeed I therefore put in place a system of pagination with codeigniter and bathroom 'routed' my url, except that when I go to http://localhost/mv/forum/sujets/3-annon...formations I got a 404 error, then when I go on http://localhost/mv/forum/sujets/3-annon...rmations/1 as y ' has it works it displays the page.

My code


PHP Code:
// On affiche la catégorie sélectionné
public function liste_des_topics($version$idcat$page=1)
 
 {
 
     $this->load->library('pagination');
 
     $data['section'] = $this->Section_model->version($version);
 
     $data['cat'    $this->Forum_model->liste_des_categories($version);
 
      
      $data
['categorie'] = $this->Forum_model->une_categorie_forum($version$idcat);
 
     //Pagination
 
 
         $config['base_url'] = base_url($version.'/forum/sujets/'.$idcat.'-'.url($data['categorie']->nom).'/');
 
         $config['total_rows'] = $this->db->where('idcat'$idcat)->get('forum_topics')->num_rows();
 
         $config['per_page'] = 2;
 
         $config['use_page_numbers'] = TRUE;
 
         $config['uri_segment'] = 5;
 
         $config['page_query_string'] = false;
 
         $config['reuse_query_string'] = false;
 
     $config['display_pages'] = TRUE;
 
 
         $data['topic'  $this->Forum_model->liste_des_topics($version$idcat$page,$config['per_page']);
 
         $this->pagination->initialize($config);
 
         $this->smarty->assign('pagination',$this->pagination->create_links());
 
      
      if 
(empty($data['topic'])) {
 
         $this->smarty->assign('vide''<div class="alert alert-danger" role="alert">Cette catégorie n\'a pas de sujet.</div>');
 
     }
 
      
      $this
->smarty->assign("meta_titre"'Liste des sujets');
 
     $this->smarty->assign("meta_description"'Liste des sujets de forum');
 
     $this->parser->parse('header.tpl');
 
     $this->parser->parse("/forum/liste_des_topics.tpl"$data);
 
     $this->parser->parse('footer.tpl');
 
      
  


My route:


PHP Code:
$route['([a-z-0-9]+)/forum/sujets/([0-9]+)-([a-z-0-9]+)/([0-9]+)'] = "forum/liste_des_topics/$1/$2/$4"


Sorry for my bad english i speak french

Basically when I access the url with the 1 it works but when I put anything I come across a 404 error while it is supposed to display the home page of the forum


 

Reply




Theme © iAndrew 2016 - Forum software by © MyBB