public function cat() {
$data['getLastNews'] = $this->article->getLastPost();
$data['category'] = $this->article->getClass();
$data['cat'] = $this->article->get_cname($this->uri->segment(3));
$cid = $data['cat']->c_id;
$cate = $data['cat']->c_name;
$csname = $data['cat']->c_sname;
$this->load->library('pagination');
$config['base_url'] = site_url() . '/home/cat/' . $csname;
$config['total_rows'] = $this->db->count_all('posts');
$config['per_page'] = $pernum = 10;
$this->pagination->initialize($config);
$currentnum = $this->uri->segment(4);
$data['list'] = $this->article->paginationList($currentnum, $pernum);
//$data['list'] = $this->article->getList($cid);
$data['title'] = $cate . '|宏志班网站|大冶实验高中2005届';
echo $this->pagination->create_links();
$this->load->view('category', $data);
}