PHP
  Home arrow PHP arrow User-defined Interfaces in PHP 5: Buil...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
JMSL Numerical Library 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

User-defined Interfaces in PHP 5: Building a Page Generator
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 12
    2006-01-09

    Table of Contents:
  • User-defined Interfaces in PHP 5: Building a Page Generator
  • Working with multiple interface implementers: defining a page generator class
  • Building object-based web pages: implementing the “PageGenerator” class
  • Full source code: listing the complete classes

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    User-defined Interfaces in PHP 5: Building a Page Generator


    (Page 1 of 4 )

    In this final part of the series on user-defined interfaces in PHP 5, Alejandro puts all of the classes created in the previous articles together to work as a page generator. This allows complex page generation to be translated into a more flexible process through an object-based solution.

    Introduction

    Here we are again. Welcome to the last part of the series “User-defined interfaces in PHP5.” Although the subject is certainly thorough enough to be the topic of a complete book chapter, this series has hopefully served as an introduction to learning the basics of interfaces, as well as demonstrated how these programming structures can be used within real applications, such as those aimed at generating web pages by utilizing an object-oriented method.

    By way of refreshing the concepts deployed in the previous article, I wrote two MySQL-processing classes that illustrated the use of the “HTMLRenderer” interface. They implemented the interface on result-type objects, and delivered fully-formatted result sets that could be easily integrated with minor difficulties into web page generation systems.

    Of course the implementation of interfaces made through MySQL-processing classes along with (X)HTML widgets has clearly proven how objects of different family types can be easily grouped through the same set of abstract methods, which have a specific definition within each pertaining class.

    Indeed, PHP5 provides web programmers with long awaited object-oriented features, such as support for interfaces, type hinting, abstract classes, and so forth, along with a powerful standard package (the Standard PHP Library), primarily intended to supply pre-built libraries for avoiding the so-called wheel reinvention.

    With reference to this final part of the series, I shall put all of the classes to work together into a full-featured example, by including the already familiar (X)HTML widgets in conjunction with the pair of MySQL-processing classes, in order to integrate both types of objects into a page generator class. As a result, complex web page generation can be translated into a more flexible process tackled through an object-based solution. Let’s go!

    More PHP Articles
    More By Alejandro Gervasio


       · Over the last part of this series, both (X)HTML widget and MySQL processing classes...
       · the problem I have with these interfaces is that you quadruple the code and...
       · Thank you for posting your comments on this article. Regarding your opinion,...
     

       

    PHP ARTICLES

    - Building a Content Management System with Co...
    - Filters and Login Systems for Web Applicatio...
    - Working with the Email Class in Code Igniter
    - Building Your Own System Tray Application Us...
    - Structuring Your Projects for Web Applicatio...
    - Inserting, Updating and Deleting Database Ro...
    - Building Your Own Desktop Notepad Applicatio...
    - Web Application Security Overview
    - Working with the Active Record Class in Code...
    - Generate PDF Documents with PHP on the Windo...
    - Sending Email with PHP Networking
    - Performing Strict Validation with the Code I...
    - The preg_replace_callback() function in PHP
    - PHP Networking
    - Validating Web Forms with the Code Igniter P...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT