In my current ZF2 project I have a complex Form
with multiple levels of nested Fieldset
s, that reflect the structure of objects to be saved in the background. Currently the data is sent directly to the Controller
and gets saved to the database, if it's valid.
Now an intermediate step should be implemented: The user should get a chance to check the input data before it's saved to the database. If he decides, that it's correct, the form data should be submitted and saved to the database; if the user decides, that the form has to be edited, he should be able to go back to the form and correct it. (Of course all that in a loop, until the user is happy with the form and submit it.)
That means, a preview page is needed. This page/action
should get the data and display it somehow (as a table or however). The data needs to be stored somewhere temporarily and be ready to be "hydrated" to the Form
object and saved. If the user wants to update the form, the form should be restored.
How can I implement this requirement?
UPDATE
I'm looking for a server-side solution. The preview should be a new page and not a JavScript/client-side generated HTML on the same page (for the tracking and other purposes).
Form
? And where to store -- in the session? – Athletics