News Feed
Jobs Feed
Sections




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

DevShed:
Using Abstract Factory Classes in PHP 5 to Work with Online Forms
February 08, 2007 @ 08:28:00

DevShed has posted the final installment of their series looking at the creation and use of the Abstract Factory pattern. In this new part, they focus on the creation of online forms and their handling as the pattern is applied.

In this last installment of the series, I'm going to show you how to use an abstract factory class to create distinct types of form objects, logically depending on the context where they will be utilized. The idea not only sounds interesting, but it can provide you with a better understanding of how this handy pattern can be used in a real situation.

They start by defining their abstract factory form class and extending it to create a required form element and a normal form element. They make input functions for each - required input box, required radio button, required check box - and their "Normal" counterparts. Finally, they tie these all together to create a simple form with sets of an input box, radio set, and checkboxes both required and normal.

0 comments voice your opinion now!
tutorial design pattern abstract factory class form create tutorial design pattern abstract factory class form create


blog comments powered by Disqus

Similar Posts

Tobias Schlitt's Blog: Avoid an endless pifall

Chance Garcia's Blog: MAMP PRO, PECL, SSH2, and OSX CLI (AKA acronym madness)

Zend Developer Zone: PHP and Java: Using Java Print Service with Zend Server Community Edition

DevShed: Tracking a Stack of Function Calls with the Xdebug Extension

Evert Pot's Blog: HTTP Basic and Digest authentication with PHP


Community Events











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


symfony2 unittest component framework code hhvm facebook overview package introduction application release language hack series podcast security install opinion composer

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