News Feed
Sections




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

DevShed:
User-defined interfaces in PHP 5 - Implementing (X)HTML Widgets
December 27, 2005 @ 06:46:15

DevShed has the latest in their "User-defined interfaces in PHP5" series posted today - Implementing (X)HTML Widgets - a look at how to create bits of reusable code (widgets) to help make your development process more object oriented.

In this second part of the series, you will learn the basics of object-oriented web page generation through the use of (X)HTML widgets. You will also see how objects implement the "HTMLRenderer" interface to explicitly define its functionality by using the "toHTML()" method.

The drawback to the "widget" approach resides mainly in the performance cost of creating many objects for rendering a web document, even if they only exist until the page has finished displaying.

They jump right in, creating the base for their widgets, the HTMLRenderer interface. From there, they show how to create the widget classes and interface them in with the HTMLRenderer (which provides a generic interface and the toHTML function for the widget subclasses).

0 comments voice your opinion now!
user-defined interface php5 (x)html widget user-defined interface php5 (x)html widget


blog comments powered by Disqus

Similar Posts

Jacob Santos' Blog: The Sexy Filter Extension and Fear of Regex

DevShed: Retrieving Information on Several Objects with Destructors in PHP 5

DevShed: Implementing Property Overloading in PHP 4

HowToForge.com: Running Apache2 With PHP5 And PHP4 At The Same Time

DevShed: Enforcing Object Types in PHP - Using the PHP5 instanceof Operator


Community Events





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


wordpress threedevsandamaybe unittest language code developer library laravel release install series introduction api list interview application configure symfony podcast community

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