php - CodeIgniter pagination Previous and active Links not Working -


i have code clicking on pagination links functions fine , if click on link particular link not showing active link . code follows

function viewcategory($name) {     $this->load->database();     $this->load->model('categorypostmod');      $page = $this->uri->segment(5);     $this->load->helper("url");     $this->load->library('table');      $this->load->model("site_model");     $this->load->helper('form');     $this->load->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 ' . $this->categorypostmod->getcategorycount($name));      $config['total_rows'] = $this->categorypostmod->getcategorycount($name);     $config['full_tag_open'] = '<ul class="pagination">';      $config['full_tag_close'] = '</ul>';      $config['use_page_numbers'] = true;      $config['next_link'] = 'next';     $config['next_tag_open'] = '<li class="next page">';     $config['next_tag_close'] = '</li>';      $config['prev_link'] = ' previous';     $config['prev_tag_open'] = '<li class="prev page">';     $config['prev_tag_close'] = '</li>';      $config['cur_tag_open'] = '<li class="active"><a href="">';     $config['cur_tag_close'] = '</a></li>';      $config['num_tag_open'] = '<li class="page">';     $config['num_tag_close'] = '</li>';      $data['query'] = $this->categorypostmod->getcategorypost($name, $config['per_page'], $this->uri->segment(5));     $records = $this->db->get('post', $config['per_page'], $this->uri->segment(5));     $this->pagination->initialize($config);      $this->load->helper("url");     $this->load->view('script');     $this->load->view('head');     $this->load->view('cat_content_list', $data);      $this->load->view('aside');     $this->load->view('bottom'); } 

controller name categorypost ,please me same code working on other controller , think missing working of how links created , looks me ci unable link clicked active 1 , please me onto .

you missed configuration of uri_segment. add config

$config['uri_segment'] = 5;//for 5 

Comments

Popular posts from this blog

How to run C# code using mono without Xamarin in Android? -

c# - SharpSsh Command Execution -

python - Specify path of savefig with pylab or matplotlib -