PHP
  Home arrow PHP arrow Completing a Web Site Template using I...
Dev Shed Forums 
Administration  
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 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
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

Completing a Web Site Template using Inheritance in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 12
    2007-07-17

    Table of Contents:
  • Completing a Web Site Template using Inheritance in PHP 5
  • Listing the signatures of the web site's base classes
  • Extending the usage of inheritance
  • Completing the development of the sample web site

  • 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

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Completing a Web Site Template using Inheritance in PHP 5
    (Page 1 of 4 )

    If you're a PHP developer who develops object-oriented applications on a frequent basis, then you'll know that inheritance can be an extremely useful concept that might help in reusing code when it comes to creating a hierarchy of classes. This article, and yesterday's, take advantage of this powerful concept and show you how to use some straightforward classes to build a complete web site that presents a consistent look across its pages.

    Introduction

    Now that I have introduced the topics that will be covered in these tutorials, let me briefly recapitulate contents of the first part of the series, in case you didn't read that article.

    As I stated at the beginning, the remarkable functionality provided by inheritance can be used in all sorts of clever ways, including the development of database abstraction layers, form generating and validating systems, error loggers, and so forth. However, in this situation I decided to demonstrate how a well-defined set of hierarchical classes can be utilized with the purpose of creating the different sections that comprise a simple web site.

    Even though the project itself may look rather primitive at first sight, it's useful for illustrating yet another approach to building web sites that expose a consistent visual appearance across their pages. And speaking specifically of creating a web site by using the concept of inheritance, you'll possibly remember that over the course of the preceding article, I showed you how to develop the classic "Home" and "About us" pages of a fictional web site utilizing a couple of inherited classes, whose respective signatures were indeed very easy to code.

    Thus, taking into account the same development methodology I described above, in this final installment of the series I'm going to complete the creation of the sample website by developing a pair of additional web pages, which will come in useful for building the typical "Products" and "Contact" sections of the web site in question.

    The experience will be instructive, so let's discover the real power behind using inheritance with PHP 5. Let's get started!

    More PHP Articles
    More By Alejandro Gervasio


       · Over the course of this final article of the series, an entire, fictional web site ...
       · disappointing. sorry.I see no need to derive a new class for every page. Should...
       · Thank you for your comments on my PHP article. I found your suggestions very...
     

       

    PHP ARTICLES

    - Comparing Files and Databases with PHP Bench...
    - Setting Up a Web-Based Image Gallery
    - Using Timers to Benchmark PHP Applications
    - Benchmarking Applications with PHP
    - Setting Up a Web-Based File Manager: PHPfile...
    - Developing a Modular Class For a PHP File Up...
    - Setting Up a Web-Based File Manager: bfExplo...
    - Defining a Custom Function for File Uploader...
    - Parsing Child Nodes with the DOM XML extensi...
    - Creating an Error Handling Module for a PHP ...
    - Accessing Attributes and Cloning Nodes with ...
    - Retrieving Information on Selected Files wit...
    - Handling HTML Strings and Files with the DOM...
    - Building File Uploaders with PHP 5
    - Working with Multiple Document Nodes with th...




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway