Zend framework multiple Validators in an array
Posted
by iSenne
on Stack Overflow
See other posts from Stack Overflow
or by iSenne
Published on 2010-04-27T21:07:04Z
Indexed on
2010/04/28
11:33 UTC
Read the original article
Hit count: 278
Hello everybody
I want to create a form in Zend framework. I am using the code below for a field:
$this->addElement('text', 'username', array(
'label' => 'Username:',
'required' => true,
'filters' => array('StringTrim'),
'validators' => array(
'alnum'
)
));
This works. But now I also want to add a new validator. In this case StrinLength
$element->addValidator('StringLength', false, array(6, 20));
How can I add this validator in the array I already have? Tnx in advanced
© Stack Overflow or respective owner