用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2654|回复: 4
收起左侧

分页问题

[复制链接]
发表于 2009-4-11 13:37:02 | 显示全部楼层 |阅读模式
$config['uri_segment'] = 3;分页方法自动测定你 URI 的哪个部分包含页数。如果你需要一些不一样的,你可以明确指定它。

各位大虾,怎样详细指定啊?

function aaa( $c, $p ){

}

比如这个函数,我要那个 $p 为页数,要怎么做呢?$config['base_url']  这个又怎么写?
发表于 2009-4-11 13:55:29 | 显示全部楼层
没看明白。P为页数。C又为什么呢?
 楼主| 发表于 2009-4-11 14:12:37 | 显示全部楼层
C是另一个参数,和分页无关的
发表于 2009-4-11 16:17:30 | 显示全部楼层
本帖最后由 yuwen002 于 2009-4-11 18:22 编辑

那你的url
http://localhost/index.php/aaa/c/p
$c = $this->uri->segment('2');
$p = $this->uri->segment('3');
具体看一下uri类吧
http://codeigniter.org.cn/user_guide/libraries/uri.html
发表于 2009-4-11 16:45:32 | 显示全部楼层
$config['uri_segment'] 这个是指定哪个 URL 段表示当前页数,这个东西不需要你处理,分页类自动处理。
index.php/第一段/第二段/第三段/..../第N段
明白了吧?

本版积分规则