Matthew Weier O'Phinney-3 wrote:
> 
> -- Samuel Verdier <[EMAIL PROTECTED]> wrote
> (on Tuesday, 05 August 2008, 03:43 PM +0200):
>> In use addError('test');
>> 
>> And : $form->isValid($formData); retour true.
>> 
>> Is this normal?
> 
> Yes. The use case for addError() is to add an error message to the
> element or form. isValid() is for validating the various form elements.
> Adding an error message is not indicative of the actual validations
> performed.
> 
This I find rather confusing. Zend_Form_Element::addError() has the
following description: "Add an error message and mark element as failed
validation". This implies that Zend_Form_Element::addError() also sets the
element to fail validation. The method Zend_Form_Element::addErrorMessage()
on the other hand has the following description: "Add a custom error message
to return in the event of failed validation" Which seems to be a more
accurate description of what you explained.
On another note, Zend_Form::addError() and Zend_Form::addErrorMessage() has
the same descriptions with the word "element" in them, which makes the
matter even more confusing.
And to make matters even a bit worse, Zend_Form_Element::addError() calls
Zend_Form_Element::markAsError() which has the following description: "Mark
the element as being in a failed validation state".
This leads me to believe that addError() was meant to actually make
validation fail, but that doesn't seem to be the case.
-- 
View this message in context: 
http://www.nabble.com/zend-form-adderror-and-isvalid-tp18831361p20813921.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to