Home arrow PHP arrow Processing File Data with Template Classes in PHP 5

Processing File Data with Template Classes in PHP 5

If you're looking for a friendly guide on how to implement the template design pattern with PHP 5, then this group of articles might be what you need. Welcome to the final installment of the series that began with "Working with template classes in PHP 5." As the title indicates, this series steps you through creating template classes in PHP-controlled development environments, and also shows you how to use this rather uncommon pattern in real-world situations.

TABLE OF CONTENTS:
  1. Processing File Data with Template Classes in PHP 5
  2. Building a basic file processing class
  3. Creating a simple template class
  4. Building a few simple subclasses
  5. Seeing the template pattern in action
By: Alejandro Gervasio
Rating: starstarstarstarstar / 2
March 26, 2007

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Introduction

Stepping back for a moment to the preceding article of the series, you'll remember that I demonstrated via a step-by-step process not only how to build a template class in PHP, but how to use it in conjunction with a few handy subclasses. Indeed, the purpose of developing the programmatic model dictated by the pattern was simply to create a group of interrelated classes, which were capable of applying different (X)HTML formatting tags to a given MySQL result set.

Of course, if you already understand how the aforementioned example worked, you shouldn't have major problems grasping all the code samples that I plan to include in this final article of the series. Why do I say this? Well, to be frank, I believe that the best way to understand the logic of a given pattern is by demonstrating its implementation with numerous hands-on examples.

Therefore, taking into account this important premise, over the course of this last tutorial I'm going to provide you with a few more examples of how to build template classes with PHP 5. More specifically speaking, what you're going to learn here will be how to create a set of template objects that will control the visual appearance of data fetched from different files.

Logically, according to the definition imposed by the template pattern, there will be a base class responsible for setting up a specific algorithm via one of its methods, and other subclasses that will use the algorithm in question.

All right, having established the objective of this article, it's time to move on and keep learning how to build template classes in PHP 5. Let's begin now!



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

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- 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...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: