分页不起作用我将post controller和model code作为under.give me solution。
控制器
public function search_me()
{
$config["base_url"] = site_url('admin_cont/search_me');
$config["total_rows"] = $this->admin_jobseeker_model->record_count();
$config["per_page"] = 2;
$config["uri_segment"] = 2;
$this->pagination->initialize($config);
$page = ($this->uri->segment(2))? $this->uri->segment(2) : 0;
$data["results"] = $this->admin_jobseeker_model->get_records($config["per_page"], $page);
$data["links"] = $this->pagination->create_links();
}
模型
function record_count()
{
return $this->db->count_all("admin_emp_job_description");
}
function get_records($limit, $start)
{
$this->db->limit($limit,$start);
$query = $this->db->get("admin_emp_job_description");
$this->output->enable_profiler(TRUE);
if($query->num_rows() > 0)
{
foreach($query->result() as $row){
$data[] = $row;
}
return $data;
}
return false;
}
问题:分页链接无法正常工作
谢谢。