Welcome Guest, Not a member yet? Register   Sign In
How can I display a Codeigniter 3 pagination as JSON?
#2

(This post was last modified: 09-01-2019, 11:09 AM by milengardev1994.)

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



Theme © iAndrew 2016 - Forum software by © MyBB