I have a few Controllers that work with content from Json files. I was wondering if Cakephp could help me paginate them.
I like Cakephp’s pagination much. It seems an extreme lot of work of writing pagination yourself and Cake’s pagination does everything I’d want for my tabular data from MySQL.
This however leaves another source of content, json-files, that are not paginated on the site. What would be the best solution for this?
I would repurpose ArraySource in the community-maintained Datasources plugin so it reads from JSON files. It already has support for pagination built in [here and here], so you should only need to add in a
connect()method that performs thejson_decode()operation. This answer provides usage instructions.