Welcome Guest, Not a member yet? Register   Sign In
problem with pagination in function - base_url().'people/assigned/index'
#1

[eluser]nemanjanq[/eluser]
problem with pagination in function - base_url().'people/assigned/index'

this is my function assigned() inside controller people, why is this not working ?

Code:
function assigned()
{
    $this->load->library('pagination');
    $config['base_url'] = base_url().'people/assigned/index';
    $config['per_page'] = '2';
    $config['total_rows'] = $this->db->count_all('people');

    $this->load->model('get');
    $data['query'] = $this->get->get_people($config['per_page'],$this->uri->segment(4), FALSE, '', TRUE);

    $this->pagination->initialize($config);

    $data['title'] = 'People';
    $data['display_msg'] = FALSE;
    $this->load->view('people/people', $data);
}
#2

[eluser]nemanjanq[/eluser]
this part is not working

Code:
<?php echo $this->pagination->create_links(); ?>

when I go to URL people/recently_added/index/2, I get correct respond from DB, but new paginations links are not generated.
#3

[eluser]n0xie[/eluser]
Try to add this:
Code:
$config['uri_segment'] = 4;
#4

[eluser]nemanjanq[/eluser]
Works! Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB