News Feed
Sections




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

Developer.com:
Forms Validation with CakePHP
November 06, 2006 @ 07:56:00

In this new tutorial from Developer.com, they take one of the popular PHP frameworks currently - CakePHP - and demonstrate how to make a simple form, complete with validation.

They start with a brief look at what CakePHP is and where you can get it from as well as the basics of input validation concepts. From there, it's on to the default validators that are included with the framework.

CakePHP offers several default validators capable of ensuring a value is a valid email address (VALID_EMAIL), year (VALID_YEAR), number (VALID_NUMBER), or non-empty (VALID_NOT_EMPTY).

Thanks to these built-in validation methods, some of the most common input validations are a snap. If you need a little something more, though, the framework has you covered there too with custom validators - as easy to implement as its preset counterparts. Finally, they show how to set custom messages in your form, both error and notification, and tie it all together in a simple form that validates the input for a "team name" field to ensure it's all alpha characters.

0 comments voice your opinion now!
cakephp framework form validation builtin custom message cakephp framework form validation builtin custom message


blog comments powered by Disqus

Similar Posts

PRADO Watch Blog: PRADO Watch: Interview With Timani Tunduwani - Why I Moved From CakePHP to PRADO

SitePoint PHP Blog: Build your own PHP Framework with Symfony Components

Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 2)

SitePoint PHP Blog: eZ components - New competition for Zend PHP Framework

Richard Miller\'s Blog: UPHPU meeting on custom 404 pages


Community Events

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


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

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