当在CakePHP 2.4.2中对分页结果进行分页时,视图中的$this->params['paging']['Post']['nextPage']
参数对于所有页面始终为1。 prevPage
参数也是如此。
以下是第2页paging
数据的显示方式
[paging] => Array
(
[Post] => Array
(
[page] => 2
[current] => 40
[count] => 1719
[prevPage] => 1
[nextPage] => 1
[pageCount] => 43
[order] => Array
(
[Post.created] => DESC
)
[limit] => 40
[options] => Array
(
[page] => 2
)
[paramType] => named
)
)
以下是控制器中的$this->paginate
设置。
Array
(
[conditions] => Array
(
[Post.published] => 1
)
[contain] => Array
(
[Feed] => Array
(
[fields] => Array
(
[0] => id
[1] => board_id
)
[Board] => Array
(
[fields] => Array
(
[0] => id
[1] => title
[2] => key
)
)
)
[PostFeature] => Array
(
[fields] => Array
(
[0] => id
[1] => width
[2] => height
[3] => url
[4] => color
)
)
)
[fields] => Array
(
[0] => id
[1] => feed_id
[2] => post_feature_id
[3] => title
[4] => summary
[5] => author
[6] => url
[7] => score
[8] => published_when
[9] => board_count
[10] => like_count
[11] => liked
[12] => tagged
)
[order] => Array
(
[Post.created] => DESC
)
[limit] => 40
[maxLimit] => 40
)
我无法弄清楚为什么paginator没有向视图发送正确的上一页/下一页数?
答案 0 :(得分:0)
愚蠢的我。
这些参数不是页码。如果集合中存在next或prev页面,则它们是布尔值。所以价值是正确的。
我会把它留在这里以拯救其他人的尴尬。