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

[eluser]Unknown[/eluser]
hi all... my pagination link remain active on the first link regardless of which page i am. i dont know where the problem is coming from.. please review my code, i may just be missing something

controller code

Code:
public function view($region, $slug, $offset=0)
    {        
        $query = $this->question->get_question_by_slug($slug);
        $replies = $this->question->get_question_replies($query->id, $offset);
        $replies_total = $this->question->get_question_replies_total($query->id);
        
        

        // pagination links for replies
        $config['base_url'] = base_url().'/question/view/'. $region . '/' . $slug;
        $config['total_rows'] = $replies_total;
        $config['per_page'] = '10';
        $config['uri_segment'] = 4;
        $config['num_links'] = 2;
        $config['full_tag_open'] = '<p style="text-align:right">';
        $config['full_tag_close'] = '</p>';
        
        $config['num_tag_open'] = '<span class="page_num">';
        $config['num_tag_close'] = '</span>';
        
        $config['cur_tag_open'] = '<span class="page_num_cur">';
        $config['cur_tag_close'] = '</span>';
        
        $config['next_link'] = 'Next';
        $config['next_tag_open'] = '<span class="page_num">';
        $config['next_tag_close'] = '</span>';
        
        
        $this->pagination->initialize($config);
        $data['pagination'] = $this->pagination->create_links();
        $data['views'] = $this->question->get_views($data['question']->id);
        
        $this->load->view('temp_header', $data);
        $this->load->view('navigation');
        $this->load->view('temp_question_view');
        $this->load->view('temp_footer');
    }
#2

[eluser]adityamenon[/eluser]
I'm actually facing this same issue. Two posts since 2009 about this same problem have remained unanswered. Is it something obvious that is being missed here?
#3

[eluser]adityamenon[/eluser]
Sorry, I found the answer to my specific problem. It was setting the uri_segment wrong...




Theme © iAndrew 2016 - Forum software by © MyBB