Hudzilla.org - the homepage of Paul Hudson
Contents > Objects Wish List | Report Bug | About Me ]

6.19     The Object-Oriented Website

This is NOT the latest copy of this book; click here for the latest version.

One of the most-requested additions to this book was a discussion on how to use OOP to render web objects - namely a messageboard, a poll, or even the website's HTML itself. After all, for a book called "Practical PHP Programming", there's an awful lot in here about dogs!

The first thing we're going to look at is make your site object-oriented in a very simple way - we'll make a site class and a page class. Then we'll move onto looking at how we could subclass the page class so that we can have different types of page rendering differently. If you're looking for information on how to make an object-oriented messageboard, this is under the Practical PHP chapter, at the end of the section on messageboards.





<< 6.18 Deferencing object return values   6.19.1 A basic OOP site >>
Table of Contents
Want to see this stuff in print? PHP in a Nutshell takes the core topics covered here, adds in thousands of edits from the editorial team and myself, and combines them to make an unbeatable reference for PHP programmers at all levels.



My latest book has hundreds more tips on how to use PHP, Apache, and MySQL, plus Perl, Python, shell scripts, performance tuning, and more!



Top-right shadow
 
Bottom-left shadow Bottom shadow

Comments from other readers
A PHP User - 13 Oct 2008

omg the fun really begins now :)



Add comment
Please note that by posting a comment here you are committing it to the public domain. This is important so that others can make use of your code themselves, and also so that I can incorporate helpful notes directly into the main text. Comments are limited to 2000 characters in length.

If you are reporting an error in the content, please tell me directly.

Your name/email address:
Your comment:
 
Now, in order to verify that you're a real person, please answer this simple question: what is four plus seven?
The answer is:
(please write in
numbers, eg 19)


Top-right shadow
 
Bottom-left shadow Bottom shadow