Colin,

The good answer is that there is no good answer. There's a multi-page form component in the proposal process, but as for PRG (post-redirect-get) forms in Zend Framework right now? You're stuck with writing your own controllers, views and using Zend_Filter_Input and similar validations manually.

Might add your comments to this proposal though:

http://framework.zend.com/wiki/pages/viewpage.action?pageId=4213

Kevin McArthur

Colin Guthrie wrote:
Hi,

Apologies if this has been covered before, but I did search quite a bit and asked on IRC before posting!

As per general recommendations, in my code, I never produce any output on a posted page, but instead issue a redirect header. This prevents the back button breaking and people accidentally double posting things when doing so etc. Great.

In order to pass messages of the ilk "Update successful"/"Update failed", I use the Flash Messenger. Also great.

But I'd really like to pass the whole of the Zend_Form across with my messages so I can redisplay the form.

I can't see anything obvious in the docs to do this, so will I just have to build something similar to flash messenger (or extend it) to accept adding a form to it.

I presume due to the sub form support[1] and some other posts I've read[2], that Zend_Form is "session safe"?

If it's not I guess I'd have to store the ->getValues() (or ->getUnfilteredValues() and the ->getMessages()/->getErrors()/->getErrorMessages() and then pass then over, then set them on a recreated form with ->populate() and ->setErrors()/->setErrorMessages() or something like that.

(I'm a little confused as to what the differences are between ->getMessages()/->getErrors()/->getErrorMessages() are (and their set* counterparts. The API docs are far from clear on their use).

Any help/insights appreciated.

Cheers

Col

[1] http://weierophinney.net/matthew/archives/159-Zend_Form-Advanced-Features.html
[2] http://www.mail-archive.com/[email protected]/msg05573.html


--

Kevin McArthur

StormTide Digital Studios Inc.
http://www.stormtide.ca

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to