sreenu
sreenu

Reputation:

Zend_Validator Question?

how to validate letters and whitespaces using Zend Framework ?

Upvotes: 1

Views: 425

Answers (2)

dcousineau
dcousineau

Reputation: 2212

The Zend Framework does have a Zend_Validate_Alpha (as well as an alphanumeric version).

Normally it doesn't allow white space, but if you pass a true into the constructor of the Zend_Validate_Alpha class it will allow whitespace. Same with Zend_Validate_Alnum.

For example:

$validator = new Zend_Validate_Alpha(true); //will allow whitespace and non number letters

Upvotes: 3

Irmantas
Irmantas

Reputation: 3321

i think Zend_Validate_Regex is best for this situation

Upvotes: 0

Related Questions