0
我是codeigniter的新手,我通過從類別ID獲取查詢結果使用codeigniter分頁,但頁面總是從第2頁開始。 如何修復分頁以設置頁碼1的開始頁面?分頁codeigniter始終在第2頁開始,並且活動鏈接始終在第2頁
public function kategori($kat=''){
$config['base_url'] = base_url().'index.php/lowongan/kategori/'.$kat;
$data['db']=$this->query->katPostingan($kat);
$config['total_rows'] = $data['db']->num_rows();
$config['per_page'] = 1;
$config['uri_segment'] = 4;
$this->pagination->initialize($config);
$data2['paging'] = $this->pagination->create_links();
$page = ($this->uri->segment($config['uri_segment'])) ? $this->uri->segment($config['uri_segment']) : 0;
$data2['records'] = $this->query->katPos($kat, $config['per_page'], $page);
$this->load->view('user/hal_kategori',$data2);
}
和我的模型
public function katPos($kat='',$limit,$start){
$this->db->where("id_kat", $kat);
$this->db->limit($limit,$start);
$query = $this->db->get("showKat");
return $query;
}
public function katPostingan($kat=''){
$this->db->where("id_kat", $kat);
$query = $this->db->get("showKat");
return $query;
}
什麼的$吉傳遞給駕駛員學校 –
$吉的初始值的初始值是從類別分類編號,所以如果通過URL http://localhost/kp/index.php/lowongan/ kategori/0001,那麼$ kat值是0001 –