我正在制作包含项目中所有日志的日志表,使用 CI 的分页我创建了分页数据。现在的问题是我还必须根据不同的日志类型和分页来过滤日志,我已经尝试了很多但仍然无法弄清楚如何生成分页链接以进行搜索。我正在粘贴控制器代码谢谢。
{
if($this->input->post('show'))
$logtype_filter = $this->input->post('log_type');
else
$logtype_filter ='';
// load pagination class
$this->load->library('pagination');
$config['base_url'] = base_url().'admin/logs/';
$config['total_rows'] = $this->db->count_all('netsynclogtable');
$config['per_page'] = '20';
$config['first_link'] = FALSE;
$config['last_link'] = FALSE;
$config['prev_link'] = 'Previous';
$config['next_link'] = 'Next';
$config['next_tag_open'] = '<li class="next">';
$config['next_tag_close'] = '</li>';
$config['prev_tag_open'] = '<li class="previous">';
$config['prev_tag_close'] = '</li>';
$config['num_tag_open'] = '<li>';
$config['num_tag_close'] = '</li>';
$config['cur_tag_open'] = '<li class="active">';
$config['cur_tag_close'] = '</li>';
$this->pagination->initialize($config);
//load the model and get results
$this->load->model('Logger_model');
$data['logs'] = $this->Logger_model->get_logs($config['per_page'],$this->uri->segment(3),$logtype_filter);
$data['logtypes'] = $this->Logger_model->get_log_types();
$data['_view'] = 'admin/logs';
// load the view
$this->load->view('layouts/admin',$data);
}