Home arrow PHP arrow Previous or Next? Paginating Records with PHP - Part 2

Previous or Next? Paginating Records with PHP - Part 2

In the first article in this series, we learned how to do simple pagination of records taken from a text file. In this article, we will look at pagination for a larger group of records, using an Objected Oriented rather than a procedural approach to creating the application.

TABLE OF CONTENTS:
  1. Previous or Next? Paginating Records with PHP - Part 2
  2. Taking the procedural approach: the friendly "paginateRecords()" function
  3. Taking the OOP approach: defining the "Pager" PHP class
  4. Defining the "displayRecords()" method
  5. Source code ahead: completing the "displayRecords()" method
  6. Pager class implementation
By: Alejandro Gervasio
Rating: starstarstarstarstar / 10
May 03, 2005

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Introduction

Welcome to Part II of the article "Previous or Next? Paginating Records with PHP." I really hope that you enjoyed reading the first article as much as I did writing it. For those faithful readers who spent some time reading over the first part, I have good news. In this second part, we're going to head toward the OOP approach, defining a class for paginating records. In this way we will discover a better solution, useful for applying to larger Web projects.

However, for those catching up right now, don't be disappointed! Before we go more deeply into any attempt to define a PHP class, we'll review the concepts previously explained, looking briefly at the function originally created to paginate records, which used a procedural orientation.

Having examined the preliminaries, it's time to go more deeply into the area of record paging in PHP. Are you ready to move on? Fine, because it's going to be really fun. Let's get started.



 
 
>>> More PHP Articles          >>> More By Alejandro Gervasio
 

blog comments powered by Disqus
   

PHP ARTICLES

- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 7 - Follow our Sitemap

Dev Shed Tutorial Topics: