How to validate either Zend_Form_Element_File or Zend_Form_Element_Text are not empty.
问题 In my form, I want user to pick a file OR enter it's URL. One of two options. I know how to write a validator for either one of two Zend_Form_Element_Text elements, but since data from Zend_Form_Element_File is not in $_POST but in $_FILES I don't know where to begin - I can't get the data from Zend_Form_Element_File to be in a $context in isValid($value, $context = null) method for my custom validator. Any ideas? 回答1: A possible approach I can think of is to pass the information if the file