CakePHP provides a handful of validation rules out of the box, which together covers the need for most applications. The following table lists the built-in validation rules (found in CakePHP's Validation
class.)
Rule |
Purpose |
---|---|
|
Checks that the value contains only integers or letters. |
|
Checks that the string length of the value is within the specified range. |
|
Succeeds if the value is empty, or consists of only spaces (whitespaces, tabs, newlines, and so on). |
|
Checks if value can be interpreted as a Boolean. |
|
Validates a credit card number. |
|
Compares the value to a given value, using the specified operator. |
|
Validates the value using a custom regular expression. |
|
Validates the value as a date, using the given format or regular expression. |
|
Succeeds if value is a valid decimal number. |
|
Validates an e-mail address. |
|
Succeeds... |