Я создал нумерацию страниц в codeigniter, но ссылки на ссылку нумерации страниц неверны.
это выглядит как
1 = "", 2 = "1", 3 = "4"
Как лучше всего исправить ссылки на индексы нумерации страниц?
Всего в таблице 5 записей, и мне нужно показать 2 записи на странице (например)
Контроллер
$this->load->model("candidate_model");
$this->load->model("client_model");
//$data["candidate"] = $this->candidate_model->fetch_candidate();
$this->load->library('pagination');
$config['base_url']="http://localhost/hol/auth/client_enter";
$config['per_page'] = 2;
$config['total_rows'] = 5;
$config['uri_segment'] = 3; //see from base_url. 3 for this case
$config['prev_link'] = '<';
$this->pagination->initialize($config);
$data["candidate"] = $this->client_model->fetch_candidate();
$data["designation"] = $this->candidate_model->fetch_designation();
$this->load->view('client_home', $data);
модель
function fetch_candidate()
{
$query = $this->db->query("SELECT U.user_id, U.firstname, U.lastname,U.username,U.usertype,U.email,U.phone,U.address, U.profile_image, C.name AS
country,C.id AS countryid, S.name as state,S.id as stateid, A.housename,A.street,A.area,A.po,A.city, CJ.designation,
CJ.resume, CJ.biography, CJ.hiring_mode, CJ.notice_period, CJ.current_CTC, CJ.expected_CTC, D.designation_id as
desig, D.designation as desig_name from users as U LEFT JOIN address as A on U.user_id=A.cand_id LEFT JOIN
cand_job_details AS CJ on CJ.cand_id=U.user_id LEFT JOIN designations as D on D.designation_id=CJ.designation LEFT
JOIN countries AS C on C.id=A.country LEFT JOIN states as S on S.id=A.state where usertype='1' && U.status='1' limit 1,2");
return $query;
}
вид
<?php echo $this->pagination->create_links(); ?>