【发布时间】:2017-06-22 08:30:34
【问题描述】:
我有一个产品列表,当我按下一个子类别时,它会加载该子类别中的所有产品并将索引用作:
http://localhost/ClickBasket/listproductscontroller/index?subcategory=4
因为它可以包含很多产品,所以我使用了 CI 的分页库。当我转到第二页或第三页时效果很好:
http://localhost/ClickBasket/listproductscontroller/index/1?subcategory=4
http://localhost/ClickBasket/listproductscontroller/index/2?subcategory=4
但是当我返回第一页时,它会丢失子类别的id:
http://localhost/ClickBasket/listproductscontroller/index
因此,在页面中找不到该子类别及其产品的数据。你如何解决这个问题?我还在学习 CodeIgniter 的分页库。
【问题讨论】:
-
你能分享你的控制器逻辑吗?您可以在控制器中处理它
标签: php html codeigniter pagination