2009年2月1日星期日

[fw-mvc] Zend_Form::addError

Tried to see if this was asked before...I'm trying to take advantage of the FormErrors decorator in my form by calling $this->addError in my overwritten isValid() method. Unfortunately the error do not show up on top of my form. Looking through the code in Zend_Form_Decorator_Form_Errors::_recurseForm(), I don't even see how it would display anything. That code looks through all the form and sub form elements, and sets $element = $form->$name; to the current element, which of course means that it never looks for anything else in the Zend_Form::getMessages() array. 
Is there another way to accomplish this?

没有评论: