O'Reilly logo

CakePHP 2 Application Cookbook by Jorge González, James Watts

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Pagination

CakePHP provides a core Pagination component to process the request parameters in the controller and build the model queries to retrieve paginated data. Instead of getting all the rows from your table, based on the current request parameters, the Pagination component will retrieve only the current page, defined as a limited amount of rows. Of course, all of the pagination settings can be configured, such as to define a specific page limit or change the default ordering of the paginated data.

Just after creating your initial CRUD for any database table, you'll get a fully paginated index view. In this recipe, we'll tweak the pagination defaults to use some URL query string parameters instead of named parameters (named params are deprecated ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required