Does CakePHP need a model to do pagination?
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 the json_decode()
operation. This answer provides usage instructions.
精彩评论