0

在 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
)

我不明白为什么分页器没有向视图发送正确的上一页/下一页页码?

4

1 回答 1

0

愚蠢的我。

这些参数不是页码。如果集合中存在下一页或上一页,则它们是布尔值。所以值是正确的。

我会把它留在这里以免其他人感到尴尬。

于 2013-10-25T14:54:29.363 回答