PHP
  Home arrow PHP arrow User-defined Interfaces in PHP 5: Building a Page Generator
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
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? 
Google.com  
PHP

User-defined Interfaces in PHP 5: Building a Page Generator
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 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:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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
     

       

    PHP ARTICLES

    - Implementing Factory Methods in PHP 5
    - Merging a File Split for FTP Upload using PHP
    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek