Home arrow PHP arrow Completing a Web Site Template using Inheritance in PHP 5

Completing a Web Site Template using Inheritance in PHP 5

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.

TABLE OF CONTENTS:
  1. Completing a Web Site Template using Inheritance in PHP 5
  2. Listing the signatures of the web site's base classes
  3. Extending the usage of inheritance
  4. Completing the development of the sample web site
By: Alejandro Gervasio
Rating: starstarstarstarstar / 14
July 17, 2007

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

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
 

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: