在 CakePHP 2.4.2 中对结果进行分页时$this->params['paging']['Post']['nextPage']
,视图中的参数对于所有页面始终为 1。参数也是如此prevPage
。
这是paging
第 2 页上的数据的样子
[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
)
我不明白为什么分页器没有向视图发送正确的上一页/下一页页码?