Hi,
I'm a bit confused here.
Say I have a form:
$form = new Zend_Form();
then I set an error on it.
$form->addError("It's broken");
But when I try and retrieve that error it doesn't work.
$form->getErrors(); // returns array();
but:
$form->isErrors(); // true.
Looking at the code, I see that the getErrors() loops through the
elements and uses the element name to show the errors. Various other
view helpers etc, also do similar things.
The question I have is why is there an addError() method on the form
object if the errors you add with it can never be used? I can see the
value for subforms or elements as these inherently have "names" against
which to attach the error.
I think what I was ultimately going to do (pass a series of specific
notes to be rendered after a PRG - in addition to a generic message via
FlashMessage), I'll end up doing differently, but this is still a bit of
a confusing part of the API for me so any clarifications would be
appreciated.
Col
PS using 1.10.1
--
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/
Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
Mandriva Linux Contributor [http://www.mandriva.com/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]