第一次 使用ci 的 pagination 的时候 很马虎、忘记配置$config['uri_segment']
如果你的分页引用 在没有任何参数的时候 使用api里的代码是没有问题的
$this->load->library('pagination');
$config['base_url'] = 'http://example.com/index.php/test/page/';
$config['total_rows'] = '200';
$config['per_page'] = '20';
$this->pagination->initialize($config);
echo $this->pagination->create_links();
--
但是如果 你的应用url如果是这样
[http://example.com/index.php/test/page/beijing/]
显然多一个参数 那么多参数的情况下一定要设置
$config['uri_segment'] 默认的情况下是3
根据你的参数不同 设置 $config['uri_segment']的值
否则 你的分页 显示后 总是第一页 不会变的!开始以为是bug 后来认真看了一下文档了解自己马虎了!
呵呵
分享到:
相关推荐
本文实例讲述了CodeIgniter分页类pagination使用方法。分享给大家供大家参考,具体如下: controller控制器(application/controller/page.php文件): public function index() { $this->load->model ( 'home_...
本文讲述了CodeIgniter视图使用注意事项。分享给大家供大家参考,具体如下: CI中视图即application/views/下的模版文件,模版中支持直接使用PHP,所以模版的实现没有太多好说的,说几点视图的注意事项: 1、CI的...
PHP框架之CodeIgniter留言板实例PHP框架之CodeIgniter留言板实例PHP框架之CodeIgniter留言板实例PHP框架之CodeIgniter留言板实例PHP框架之CodeIgniter留言板实例PHP框架之CodeIgniter留言板实例PHP框架之CodeIgniter...
CodeIgniter最新版本,开源、免费、轻量级的web编程,基于MVC的编程架构能大大提高php编码生产力。
CodeIgniter 相关文档资料,包括中文手册,使用教程,以及框架分析
CodeIgniter框架
codeigniter 代码实例分享,基于jquery1.4,codeigniter,eclipse 开发
敏捷php开发框架CodeIgniter 1.7.1中文手册
CodeIgniter_2.1.4.zip
CodeIgniter 架构 教程. CodeIgniter 架构的使用说明教程.
codeigniter分页
codeigniter中文文档codeigniter中文文档codeigniter中文文档codeigniter中文文档codeigniter中文文档
CodeIgniter最新版 CodeIgniter1.72版 帮助文档 帮助文件
CodeIgniter_2.0.0.zip CodeIgniter_2.0.0.zip CodeIgniter_2.0.0.zip
研究了半天的codeigniter,基本把结构弄清楚了。
codeigniter(CI)中文手册下载
CodeIgniter1.7敏捷框架开发最新出版书(EN)