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

Jonathan Snook's Blog:
CakePHP Data Validation
June 20, 2006 @ 05:42:38

Jonathan Snook continues his look at the CakePHP framework today with this new post on his blog, specifically looking at data validation methods.

Validation is one of the basic and most tedious tasks in application development. If there was ever a reason to use a framework this would be it. There are two ways that appear to be advocated by the CakePHP site and while both have benefits, I'm using a slightly different approach.

The "two ways" he mentions are auto-validation and using the validates() function (different from the suggestion in the CakePHP wiki of overriding the beforeSave() function). The first is built-in functionality, and is simpler to use. It allows you to define custom profiles for your values, ensuring they match the requirements. Using the validates() function is actually overriding a standard function and can be used to do more custom validation on the values passed back in.

0 comments voice your opinion now!
cakephp data validation autovalidate validates function cakephp data validation autovalidate validates function


blog comments powered by Disqus

Similar Posts

Community News: CakePHP 2.0 Released (with some Major Changes)

Lorna Mitchell: PHP 5.6 and the Splat Operator

Jordi Boggiano's Blog: Unpredictable hashes for humans

Stefan Mischook's Blog: Creating Your Own Functions - Part 2

Paul Jones' Blog: How Fast Is Your Framework?


Community Events











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


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

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