title: CodeIgniter pagination Previous and active Links not Working
body: <p>I have a code where clicking on pagination links functions fine , but if i click on a link that particular link is not showing as active link .
  my code is as follows </p>
  
  <pre><code>function viewcategory($name) {
      $this-&gt;load-&gt;database();
      $this-&gt;load-&gt;model('categorypostmod');
  
      $page = $this-&gt;uri-&gt;segment(5);
      $this-&gt;load-&gt;helper("url");
      $this-&gt;load-&gt;library('table');
  
      $this-&gt;load-&gt;model("site_model");
      $this-&gt;load-&gt;helper('form');
      $this-&gt;load-&gt;library('pagination');
      $config['base_url'] = "http://localhost/b3/index.php/CategoryPost/viewcategory/" . $name . "/page/";
      $config['per_page'] = 2;
      $config['num_links'] = 5;
  
      log_message('info', 'count is ' . $this-&gt;categorypostmod-&gt;getCategorycount($name));
  
      $config['total_rows'] = $this-&gt;categorypostmod-&gt;getCategorycount($name);
      $config['full_tag_open'] = '&lt;ul class="pagination"&gt;';
  
      $config['full_tag_close'] = '&lt;/ul&gt;';
  
      $config['use_page_numbers'] = TRUE;
  
      $config['next_link'] = 'Next';
      $config['next_tag_open'] = '&lt;li class="next page"&gt;';
      $config['next_tag_close'] = '&lt;/li&gt;';
  
      $config['prev_link'] = ' Previous';
      $config['prev_tag_open'] = '&lt;li class="prev page"&gt;';
      $config['prev_tag_close'] = '&lt;/li&gt;';
  
      $config['cur_tag_open'] = '&lt;li class="active"&gt;&lt;a href=""&gt;';
      $config['cur_tag_close'] = '&lt;/a&gt;&lt;/li&gt;';
  
      $config['num_tag_open'] = '&lt;li class="page"&gt;';
      $config['num_tag_close'] = '&lt;/li&gt;';
  
      $data['query'] = $this-&gt;categorypostmod-&gt;getCategorypost($name, $config['per_page'], $this-&gt;uri-&gt;segment(5));
      $records = $this-&gt;db-&gt;get('post', $config['per_page'], $this-&gt;uri-&gt;segment(5));
      $this-&gt;pagination-&gt;initialize($config);
  
      $this-&gt;load-&gt;helper("url");
      $this-&gt;load-&gt;view('script');
      $this-&gt;load-&gt;view('head');
      $this-&gt;load-&gt;view('cat_content_list', $data);
  
      $this-&gt;load-&gt;view('aside');
      $this-&gt;load-&gt;view('bottom');
  }
  </code></pre>
  
  <p>Controller name is categorypost ,Please help me as the same code is working on other controller , i think i am missing the working of how links are created , looks like to me that CI is unable to get the link that is clicked is an active one , Please Help me onto this .</p>