• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I display a Codeigniter 3 pagination as JSON?

#2
I don't think this will work out.

Code:
$this->pagination->create_links()

This code as far as I know only generates HTML template. 

I had a similar issue and I have created custom library that can output it as JSON object.

To create the pagination you need the total pages count and amount of results per page.


Code:
$res['max_pages'] = ceil($totalImagesCount / MAX_RESULTS_PER_PAGE);

This is some example code I have used.

I hope I help you a bit!
Reply


Messages In This Thread
RE: How can I display a Codeigniter 3 pagination as JSON? - by milengardev1994 - 08-31-2019, 12:09 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.