douyonglang4845 2012-06-12 14:10
浏览 6

当数组格式不适合时,Zend paginator无法正常工作

Hi my zend paginator works well when the $business_list array format is like below.

but when the array format changes it displays only one page instead of many pages.

$paginator = Zend_Paginator::factory($business_list);

Array
(
    [0] => Array
        (
            [id] => 216
            [userid] => 141
            [title] => first req
            [image] => 
            [logo] => 
            [description] => 
this is the first requirment
            [date] => 2012-06-12 10:31:01
            [area] => 1
            [budget] => 1
            [type] => 1
            [status] => 1
            [CmBusinessSection] => Array
                (
                    [0] => Array
                        (
                            [id] => 315
                            [business_id] => 216
                            [section_id] => 1
                            [subsection_id] => 13
                            [description] => 
                        )

                    [1] => Array
                        (
                            [id] => 316
                            [business_id] => 216
                            [section_id] => 3
                            [subsection_id] => 14
                            [description] => 
                        )

                    [2] => Array
                        (
                            [id] => 317
                            [business_id] => 216
                            [section_id] => 4
                            [subsection_id] => 15
                            [description] => 
                        )

                )

            [CmUser] => Array
                (
                    [id] => 141
                    [username] => venki
                    [password] => 
                    [firstname] => venkatesh
                    [lastname] => abus
                    [image] => 54winter.jpg
                    [email] => xxx@xx.com
                    [phone] => 23423452
                    [group_id] => 2
                    [status] => 
                    [registered_date] => 2012-06-04 06:32:58
                    [last_visit] => 0000-00-00 00:00:00
                    [is_active] => 1
                    [subscribe] => 1
                )

        )

    [1] => Array
        (
            [id] => 214
            [userid] => 98
            [title] => gopicontractor
            [image] => 54bluehills.jpg
            [logo] => 239waterlilies.jpg
            [description] => 
TIt uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is
            [date] => 2012-06-11 12:18:58
            [area] => 1
            [budget] => 1
            [type] => 3
            [status] => 1
            [CmBusinessSection] => Array
                (
                    [0] => Array
                        (
                            [id] => 305
                            [business_id] => 214
                            [section_id] => 1
                            [subsection_id] => 5
                            [description] => 
                        )

                    [1] => Array
                        (
                            [id] => 306
                            [business_id] => 214
                            [section_id] => 1
                            [subsection_id] => 6
                            [description] => 
                        )

                    [2] => Array
                        (
                            [id] => 307
                            [business_id] => 214
                            [section_id] => 3
                            [subsection_id] => 1
                            [description] => 
                        )

                    [3] => Array
                        (
                            [id] => 308
                            [business_id] => 214
                            [section_id] => 4
                            [subsection_id] => 9
                            [description] => 
                        )

                )

            [CmUser] => Array
                (
                    [id] => 98
                    [username] => gopi.s
                    [password] => 
                    [firstname] => venkatesh
                    [lastname] => franc
                    [image] => 
                    [email] => ss@ss.com
                    [phone] => 23423452
                    [group_id] => 3
                    [status] => 
                    [registered_date] => 2012-05-16 12:36:57
                    [last_visit] => 0000-00-00 00:00:00
                    [is_active] => 1
                    [subscribe] => 1
                )

        )
)

the above array format displays paginatin correctly.

This is the array that displays only one page in pagination.

Zend_Paginator Object (

[_cacheEnabled:protected] => 1
[_adapter:protected] => Zend_Paginator_Adapter_Array Object
    (
        [_array:protected] => Array

            (
                [0] => Array
                    (
                        [id] => 89
                        [username] => xx
                        [password] => xx
                        [firstname] => xx
                        [lastname] => xx
                        [image] => 
                        [email] => xx@ymail.com
                        [phone] => 2342345
                        [group_id] => 2
                        [status] => offline
                        [registered_date] => 2012-05-15 10:58:53
                        [last_visit] => 
                        [is_active] => 1
                        [subscribe] => 0

                        [CmBusiness] => Array
                            (
                                [0] => Array
                                    (
                                        [id] => 204
                                        [userid] => 89
                                        [title] => xxhousing
                                        [image] => 760067.jpg
                                        [logo] => xx_818f3c97e6_o.jpg
                                        [description] => xx
                                        [date] => 2012-05-31 13:36:17
                                        [area] => 1
                                        [budget] => 1
                                        [type] => 1
                                        [status] => 1

                                        [CmAmount] => Array
                                            (
                                                [id] => 1
                                                [amount] => 1000-1500
                                                [status] => 1
                                            )

                                        [CmBusinessSection] => Array
                                            (
                                                [0] => Array
                                                    (
                                                        [id] => 251
                                                        [business_id] => 204
                                                        [section_id] => 1
                                                        [subsection_id] => 6
                                                        [description] => xx

                                                    )
                                                [1] => Array
                                                    (
                                                        [id] => 252
                                                        [business_id] => 204
                                                        [section_id] => 3
                                                        [subsection_id] => 2
                                                        [description] => xx

                                                    )
                                                [2] => Array
                                                    (
                                                        [id] => 253
                                                        [business_id] => 204
                                                        [section_id] => 3
                                                        [subsection_id] => 4
                                                        [description] => xx

                                                    )
                                                [3] => Array
                                                    (
                                                        [id] => 254
                                                        [business_id] => 204
                                                        [section_id] => 4
                                                        [subsection_id] => 9
                                                        [description] => xx
                                                    )
                                           )
                                        [CmArea] => Array
                                            (
                                                [id] => 1
                                                [area] => manchester
                                                [status] => 1
                                            )
                                        [CmType] => Array
                                            (
                                                [id] => 1
                                                [type] => Personal business
                                                [status] => 1
                                            )

                                    )
                                [1] => Array
                                    (
                                        [id] => 205
                                        [userid] => 89
                                        [title] => xx
                                        [image] => 41217850-desktop-wallpapers-new-windows-xp.jpg
                                        [logo] => 356anger_n.jpg
                                        [description] => xx

                                        [date] => 2012-05-31 13:37:15
                                        [area] => 1
                                        [budget] => 1
                                        [type] => 3
                                        [status] => 1
                                        [CmAmount] => Array
                                            (
                                                [id] => 1
                                                [amount] => 1000-1500
                                                [status] => 1
                                            )
                                       [CmBusinessSection] => Array
                                            (
                                                [0] => Array
                                                    (
                                                        [id] => 255
                                                        [business_id] => 205
                                                        [section_id] => 1
                                                        [subsection_id] => 6
                                                        [description] =>xx
                                                    )
                                                [1] => Array
                                                    (
                                                        [id] => 256
                                                        [business_id] => 205
                                                        [section_id] => 3
                                                        [subsection_id] => 1
                                                        [description] => xx
                                                    )
                                                [2] => Array
                                                    (
                                                        [id] => 257
                                                        [business_id] => 205
                                                        [section_id] => 3
                                                        [subsection_id] => 2
                                                       [description] => xx
                                                    )
                                                [3] => Array
                                                    (
                                                        [id] => 258
                                                        [business_id] => 205
                                                        [section_id] => 4
                                                        [subsection_id] => 10
                                                        [description] => xx

                                                    )
                                            )
                                        [CmArea] => Array
                                            (
                                                [id] => 1
                                                [area] => manchester
                                                [status] => 1
                                            )
                                        [CmType] => Array
                                            (
                                                [id] => 3
                                                [type] => Bilde companies
                                                [status] => 1
                                            )

                                    )
                                [2] => Array
                                    (
                                        [id] => 206
                                        [userid] => 89
                                        [title] => Nuestros recursos
                                        [image] => 
                                        [logo] => 
                                        [description] => xx
                                        [date] => 2012-05-31 13:38:04
                                        [area] => 1
                                        [budget] => 1
                                        [type] => 4
                                        [status] => 1
                                        [CmAmount] => Array
                                            (
                                                [id] => 1
                                                [amount] => 1000-1500
                                                [status] => 1
                                            )
                                        [CmBusinessSection] => Array
                                            (
                                                [0] => Array
                                                    (
                                                        [id] => 259
                                                        [business_id] => 206
                                                        [section_id] => 1
                                                        [subsection_id] => 5
                                                        [description] => 
                                                    )
                                                [1] => Array
                                                    (
                                                        [id] => 260
                                                        [business_id] => 206
                                                        [section_id] => 1
                                                        [subsection_id] => 6
                                                        [description] => 
                                                    )
                                                [2] => Array
                                                    (
                                                        [id] => 261
                                                        [business_id] => 206
                                                        [section_id] => 3
                                                        [subsection_id] => 2
                                                        [description] => 
                                                    )
                                                [3] => Array
                                                    (
                                                        [id] => 262
                                                        [business_id] => 206
                                                        [section_id] => 4
                                                        [subsection_id] => 10
                                                        [description] => 
                                                    )

                                            )
                                        [CmArea] => Array
                                            (
                                                [id] => 1
                                                [area] => manchester
                                                [status] => 1
                                            )
                                        [CmType] => Array
                                            (
                                                [id] => 4
                                                [type] => Designer
                                                [status] => 1
                                            )

                                    )

                            )

                    )

            )

        [_count:protected] => 1
    )
[_currentItemCount:protected] => 
[_currentItems:protected] => 
[_currentPageNumber:protected] => 1
[_filter:protected] => 
[_itemCountPerPage:protected] => 2
[_pageCount:protected] => 1
[_pageRange:protected] => 
[_pages:protected] => 
[_view:protected] => 

)

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 C++ yoloV5改写遇到的问题
    • ¥20 win11修改中文用户名路径
    • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
    • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
    • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
    • ¥15 帮我写一个c++工程
    • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
    • ¥15 关于smbclient 库的使用
    • ¥15 微信小程序协议怎么写
    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?