background preloader

Paginação

Facebook Twitter

Plugins. Basic Pagination Overview (1.2) (Articles) | The Bakery, Everyth. CakePHP Part 6 - Pagination! So far in our Cake tutorials, we have learned the basics of CakePHP, and used some pretty time saving and neat features. Thus far, most of these features we have implemented have been easy fixes to small issues, that save at most a few hundred of code. Today, we will be using a really neat view/controller combo that will make creating a paginated view as easy as.....well, cake! Pagination is something that any decent site has in it somewhere. The whole idea is to give the user pages of information to look through, instead of just listing all the data at once.

Not only does this cut down on page load times, but it is also a great way to view and organize the information as well. Paginating the Controller There are a lot of ways to accomplish a nicely paginated layout, some more efficient than others. The first part of this process is telling Cake to paginate all of our data retrieving calls, at least for a specific controller. The View Controls Notice the addition of the Paginator helper. Pagination - what it is and how to do it. By Tony Marston 5th January 2004 Intended Audience Prerequisites What is pagination?

How to do it - the easy way How to do it - the hard way Sample software This tutorial is intended for developers who wish to give their users the ability to step through a large number of database rows in manageable chunks instead of the whole lot in one go. It is assumed that you already have basic knowledge of PHP and MySQL.

The techniques described in this document are written with MySQL in mind but can be applied to any database that allows the LIMIT and OFFSET clauses on the SELECT statement. If you have a form which allows the user to browse through the rows in a database table, what do you do if that table has hundreds or even thousands of rows? Decide on the maximum number of database rows that can be included in each page. You then need to inform the user that other 'pages' are available and provide a mechanism whereby the user is able to select a different 'page' of details.

Pagination Area 1. 2.