In my Codeigniter project, I am trying to implement Pagination using CI's Pagination library. My Controller function is as shown below :
function uploadhistory()
{
$data['num']=20;
$this->load->library('pagination'); // library for pagination
$config['base_url'] = base_url().'video/uploadhistory/';
$config['total_rows'] = $data['num'];
$config['per_page'] = 3;
$config['page_query_string'] = TRUE;
$this->pagination->initialize($config);
echo $this->pagination->create_links();
$data['page']='video/uploadhistory';
$this->load->view('layout/template',$data);
}
The problem is, pagination URL is coming like:
http://www.domain.com/project/video/uploadhistory/&per_page=3.
What I need is like:
I have set $config['enable_query_strings'] = TRUE;
in application/config/config.php file.
Can anyone help me to find a solution to this?
Thanks in advance.
false
?, thenuploadhistory($page_num = 1)
– user1978142function uploadhistory($id)
then it will work as you wanted – bhushya$config['page_query_string'] = FALSE;
try this after above chnages – bhushya