News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

DevShed:
Building Object-Oriented Web Pages with Inheritance in PHP 5
July 16, 2007 @ 15:18:00

DevShed has posted part one of a new pair of articles that show how to use inheritance in your PHP applications.

In the two articles in this series I'm going to show you how to build a sample object-based web site from its bare bones structure, by using the encapsulated logic of some parent and child PHP 5 classes. In this way I'll demonstrate how inheritance can be used to tackle a concrete project, such as constructing dynamic web pages.

In part one, they build the foundation of their sample application - a web page builder - by defining the WebPage class and abstract methods for it like buildHeader, buildStyles and buildBody. Inheriting from this, they build a HomeWebPage class that defines the methods and values to create a simple page. They take it even a step further and build an AboutUsWebPage to show another implementation.

0 comments voice your opinion now!
php5 object oriented inhertance tutorial webpage php5 object oriented inhertance tutorial webpage


blog comments powered by Disqus

Similar Posts

Wojciech Sznapka's Blog: Accessing private object property from other object in PHP

Stefan Mischook's Blog: Cannot load mysql extension error - Video Tutorial How To

Max Horvath's Blog: How to enable the Xdebug debugger in Zend Studio for Eclipse

IBM developerWorks: What's new in PHP V5.3, Part 2: Closures and lambda functions

Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 11)


Community Events

Don't see your event here?
Let us know!


php7 podcast library series install api introduction release voicesoftheelephpant framework xdebug laravel5 example extension interview opinion community laravel unittest language

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework