Break up PHP Pagination links

前端 未结 4 1529
清酒与你
清酒与你 2020-12-19 06:49

I have the following method that creates and returns markup for my pagination links in PHP.

public function getPaginationLinks($options) {
    if($options[\'         


        
4条回答
  •  不思量自难忘°
    2020-12-19 07:21

    You could do (on page 15)

    [View Previous] 12 13 14 [15] 15 17 18 [View More]
    

    Where the [View More] link fetches the rest (or just a few more) page links. This keeps things uncluttered while allowing the user to navigate all the pages.

    Example (after clicking View Previous)

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 [15] 15 17 18 [View More]
    

    or (just show a few more) [View More] 7 8 9 10 11 12 13 14 [15] 15 17 18 [View More]

    When I say "fetch" I mean use javascript to create links to the other pages w/o reloading the page

提交回复
热议问题