我正在尝试在我的 PHP 项目中进行分页,codeigniter 有自己的名为“分页”的类,我已经使用了它。现在我在我的视图页面中有一个页面链接。但是所有数据都打印在一个页面上,这是我的代码..
$mydata = array('mydata' => $this->Admin_model->view_job_posts());
$this->load->library('pagination');;
$config['base_url'] =site_url('/admin/view_job_posts/');
$config['total_rows'] = count($mydata["mydata"]);
$config['per_page'] = 1;
$config['num_links'] = 2;
$config['uri_segment'] = 2;
$this->pagination->initialize($config);
$mydata['links'] = $this->pagination->create_links();
$this->load->view('pages/admin_view_jobs', $mydata);
帮帮我,伙计们!