search

Home  >  Q&A  >  body text

thinkPHP paging determines whether it exceeds the last page

My paging has a jump function. Now there are two pages of data in total. When I jump, entering 3 will also jump to the third page, but there is no data. Where should I write if it exceeds the end? The judgment is that the last page of data will be displayed on one page. Thank you in advance

..2313 days ago1190

reply all(1)I'll reply

  • 天忆

    天忆2018-08-28 16:20:52

    I use tp5, which uses simple paging and will pass the last page $data->lastPage(). You can then jump to write a js to pass the last page data and judge the input. If it is less than Just use input, if it is larger, use last page

    reply
    0
  • Cancelreply