AnsweredAssumed Answered

PHP Pagination - buttons?

Question asked by Lee Newton on Feb 7, 2019
Latest reply on Feb 8, 2019 by James Jones

Hi,
I'm struggling with working pagination in PHP. According to the documentation, I can use those links to go to the next page of the collected results. I can put out a certain amount of results per page, which I want, but I also want to go from page to page - I want to have working "Next", "Previous", "First" and "Last" buttons too.

 

But, in PHP, I have tried to write the exact equivalents of those, and it doesn't work. See my code:

 

'<a href="https://my.test.infrastructure.com/courses?page=1&per_page=3" rel="next">Next</a>'

 

This, unfortunately, don't work. Frankly I don't know what does.

 

I have seen other threads on this matter, but they have all focused on Python or other languages, so none of them help me. The ones I am working with are PHP foremost, with some Laravel, HTML and Blade.

Any advice? Every bit of help is greatly appreciated

Outcomes