PHP
  Home arrow PHP arrow Completing a Web Site Template using Inheritance in PHP 5
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

Completing a Web Site Template using Inheritance in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 14
    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:
      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


    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
     

       

    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