【发布时间】:2015-06-29 02:24:12
【问题描述】:
我们有一个应用程序,它的页面结果基于某些参数,例如 domain.com/index.php/welcome/student/male 这里 welcome 是控制器 student 是方法名称 male 是参数,现在我们想要分页,但问题是一个人也可以使用像这样的子类别domain.com/index.php/welcome/student/male/steven 其中steven 是另一个参数,如何为这种类型的网址创建分页。提前谢谢你:)
【问题讨论】:
-
最好使用查询字符串作为参数。否则,您必须使用
n参数数量定义您的控制器方法。public function student (gender,category,...) -
你看过 CI 的分页类吗?它会照顾你的任何水平:ellislab.com/codeigniter/user-guide/libraries/pagination.html
标签: php codeigniter pagination