// 载入分页类
$this->load->library('pagination');
$config['total_rows'] = $this->post->get_content_list('post', 'published', NULL, NULL);
$config['cur_page'] = $page;
$config['per_page'] = 10;
// 依据配置初始化分页类
$this->pagination->initialize($config);
$pagery = $this->pagination->create_links();
$offset = $this->pagination->offset;
$per_page = $this->pagination->per_page;
// 根据每页条数和位置取得分页后的内容
$posts = $this->post->get_content_list('post', 'published', $per_page, $offset);
$this->_data['posts'] = $posts;
$this->_data['pagery'] = $pagery;
$this->load->view('all_posts', $this->_data);