News Feed
Sections




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

DevShed:
Decoupling the Validation of Data with Bridge Classes in PHP 5
January 10, 2007 @ 14:03:00

DevShed has posted part two of their look at working with bridge classes in PHP5, looking in detail at the decoupling of the data validation from an input form.

In the course of this second tutorial, I'm going to show you how to create a bridge class which will come in handy for decoupling the validation of user-supplied data. There will be a class that defines generically how certain data must be verified, while others will implement different validation methods.

They start with building a simple bridge class, a validator class that defines methods to check strings, numbers, alphabetic, and email values. For each of these types, they create the corresponding bridge class that validates the input. Finally, they tie it all together, validating an example of each, handled inside of try/catch blocks to watch for the errors that might be thrown.

0 comments voice your opinion now!
php5 bridge class decouple tutorial validation form php5 bridge class decouple tutorial validation form


blog comments powered by Disqus

Similar Posts

Zend Developer Zone: Get to know Flex and Zend_Amf

Zend Developer Zone: Compressing JPEG images with JPEG Reducer

Secunia.com: SUSE update for php4 and php5

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

Mpwebwizard.com: Use a mirror for hits from popular websites


Community Events

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


programming laravel list framework community introduction php7 interview application api composer part2 language podcast yii2 symfony project series opinion example

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