Exemple #1
0
 /**
  * There is a difference between input fields that are present, but have an 
  * empty value (e.g. an empty textbox), and input fields that are not 
  * present at all (e.g. an unchecked checkbox). For some reason, Zend_Filter_Input 
  * does not take the error message for a missing field from the rule 
  * itself, but from an options array. Let's override the function that 
  * returns this message to use a message from the rule, and not the options 
  * array.
  */
 protected function _getMissingMessage($rule, $field)
 {
     if ($this->_validatorRules[$rule][self::MESSAGES][0]) {
         return $this->_validatorRules[$rule][self::MESSAGES][0];
     } else {
         return parent::_getMissingMessage($rule, $field);
     }
 }