Truncate number of pages in pagination

前端 未结 4 956
没有蜡笔的小新
没有蜡笔的小新 2021-01-16 18:44

This might be a quite silly question, but I can\'t figure anything out that might help me go further. I\'m looking to shorten the number of NUMBERS in my page navigation.

4条回答
  •  滥情空心
    2021-01-16 19:47

    This is a modified chunk of code I wrote for paging forums.

    It's output isn't exactly how you showed but should just be a matter of tweaking.

    
    
    
     1): ?>
        
  • Page of
  • 1): ?>
  • First
  • <
  • $howMany + 1): ?>
  • ...
  • = 1 && $pageIndex <= $numPages): ?>
  • ...
  • >
  • Last
提交回复
热议问题