Created
May 23, 2011 19:32
-
-
Save eminetto/987377 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$endereco = new Zend_Form_SubForm(); | |
$endereco->addElements(array( | |
new Zend_Form_Element_Text('cidade', array( | |
'required' => true, | |
'label' => 'Cidade:', | |
'filters' => array('StringTrim', 'StringToLower'), | |
'validators' => array( | |
'Alnum', | |
array('Regex', | |
false, | |
array('/^[a-z][a-z0-9]{2,}$/')) | |
) | |
)), | |
new Zend_Form_Element_Text('estado', array( | |
'required' => true, | |
'label' => 'Estado:', | |
'filters' => array('StringTrim'), | |
'validators' => array( | |
'NotEmpty', | |
array('StringLength', false, array(6)) | |
) | |
)), | |
) | |
); | |
$this->addSubForms(array('endereco' => $endereco)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment