|
public function index($num = '')
{
//配置分页
$config['base_url'] = site_url() . '/leave_msg/msg/index/';
$config['total_rows'] = $this->db->count_all('msgs');
$config['per_page'] = 5;
//$config['uri_segment'] = $this->uri->segment(4); //获取uri段上的参数
//$config['num_links'] = 1; // 当前连接前后显示页码个数
$config['full_tag_open'] = '<div class="pagination">'; // 分页开始样式
$config['full_tag_close'] = '</div>'; // 分页结束样式
$config['first_link'] = '首页'; // 第一页显示
$config['last_link'] = '末页'; // 最后一页显示
$config['next_link'] = '下一页 >'; // 下一页显示
$config['prev_link'] = '< 上一页'; // 上一页显示
$config['cur_tag_open'] = " <a href=" . $config['base_url']. 0 . ">"; // 当前页开始样式
$config['cur_tag_close'] = '</a>'; // 当前页结束样式
$this->pagination->initialize($config);
//显示分页
$data['msgs'] = $this->msgs_model->get_msgs($config['per_page'], $num);
$this->load->view("templates/header");
$this->load->view("msg/index", $data);
$this->load->view("templates/footer");
}
|
|