|
发表于 2011-10-29 09:04:40
|
显示全部楼层
如果不行的话 你可以试下运行我以下的代码 这是改了一下你的代码 你直接放在一个控制器中就可以使用了 不用 model和view层。
<?php
class Test_page extends CI_Controller
{
public function __construct()
{
parent::__construct();
}
function index(){
// $this->load->model('Messge_model');
//获取页码号
$page_start=$this->input->get('per_page')?$this->input->get('per_page'):0;
echo $page_start;
//总条数数
// $count =$this->Messge_model->get_product_count();
//每页显示条数
$tiaoshu=5;
//分页
$this->load->library('pagination');
$config['base_url'] = site_url().'/Test_page/index';
$config['uri_segment'] =3;
$config['total_rows'] = 100;
$config['per_page'] =10;
$config['first_link'] = '首页';
$config['first_tag_open'] = '<li class=" first">';
$config['first_tag_close'] = '</li>';
$config['last_link'] = '末页';
$config['last_tag_open'] = '<li class=" first">';
$config['last_tag_close'] = '</li>';
$config['next_link'] = '下一页';
$config['next_tag_open'] = '<li class="latestnewnextpage">';
$config['next_tag_close'] = '</li>';
$config['prev_link'] = '上一页';
$config['prev_tag_open'] = '<li class=" latestnewprepage">';
$config['prev_tag_close'] = '</li>';
$config['cur_tag_open'] = '<li class="latestnewcurrentpage">';
$config['cur_tag_close'] = '</li>';
$config['num_tag_open'] = '<li id="page_2">';
$config['num_tag_close'] = '</li>';
$this->pagination->initialize($config);
//页面展示数据
$data['page_view']= $this->pagination->create_links();
print_r($data['page_view']);exit;
$data_list1=$this->Messge_model->addlist_model($page_start,$tiaoshu);
$data['data_list']=$data_list1;
$this->load->view("messgelist_view",$data);
}
}
?> |
|