QuickForm: storing the whole form in a session variable
| From: | Mirko Werneke | Date: | Sun, 06 Nov 2005 09:22:58 +0000 |
| Subject: | QuickForm: storing the whole form in a session variable | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-21814@lists.php.net to get a copy of this message | ||
Hi,
I'm trying to store a QuickForm-object in a session variable.
I'm thinking about this:
if (!isses($_SESSION['form']) {
$form = new HTML_Quickform('blubb', 'post');
$form->addElement ...
$_SESSION['form'] = $form;
} else {
$form = $_SESSION['form'];
}
if ($form->validate()) {
...
}
This would save me the form recreation in the process/validate phase.
Sadly this fails because PHP complains about not defined QuickForm
subclasses while restoring the session.
Is there another way to achieve my goals? I have to create my forms of
lots of data that needs to be collected and processed first. So avoiding
the creation of the form in the processing phase would save me a lot of
execution time.
Regards
Mirko