CI框架分页
先在\application\helpers 创建一个函数文件func_helper.php
/**
* [pageinfo CI 分页函数]
$url [分页链接地址]
$total [总数]
$limit [每页显示的数量]
$segment[页码在地址的第几段]
$theme ['分页主题类型']
[strimg] [跳转或后退的字符串]
*/
function pageinfo($url,$total,$limit,$segment,$theme=1){
$CI = &get_instance(); // 获取全局的CI对象,才能加载类
$CI->load->library('pagination'); //加载分页类
$config['base_url'] = $url; //分页链接
$config['total_rows'] =$total;//总数
$config['per_page'] = $limit;//每页显示多少条记录
$config['use_page_numbers'] = TRUE; //让地址参数显示为页码
$config['uri_segment'] = $segment; //页码所在的段数
$config['first_link'] = '首页'; //首页链接
$config['first_tag_open'] = '<li>'; //开始标签
$config['first_tag_close'] = '</li>'; //结束标签
$config['last_link'] = '最后一页';
$config['last_tag_open'] = '<li>';