0
任何人都可以请帮助我吗?我想分页我的表格。所有链接都在工作,但是这些项目在其他页面上重复。我在这里尝试了类似的问题,但没有任何工作。codeigniter分页:链接正在工作,但记录在其他页面上重复
function index($type="deposit", $limit_from=0)
{
$limit_from = ($this->uri->segment(4)) ? $this->uri->segment(4) : 0;
$total_records = $this->Expense->get_total_rows($type);
$data['controller_name'] = $this->get_controller_name();
$lines_per_page = 3;
$data[$type.'s'] = $this->Expense->get_records($lines_per_page, $limit_from, $type);
$config['base_url'] = base_url('index.php/expenses/index/'.$type);
$config['total_rows'] = $total_records;
$config['per_page'] = 3;
$config["uri_segment"] = 4;
// $choice = $total_records/$config['per_page'];
// $config['num_links'] = round($choice);
$config['use_page_numbers'] = TRUE;
$config['first_url'] = base_url('index.php/expenses/index/'.$type.'/1');
$this->pagination->initialize($config);
$data["links"] = $this->pagination->create_links();
$this->load->view('expenses/'.$type, $data);
$this->_remove_duplicate_cookies();
}
你好, 请参考此链接,也许你会得到帮助! https://www.formget.com/pagination-in-codeigniter/ – Afzal