Can you serialize a Formbuilder object?
| From: | Andrew Wooldridge | Date: | Mon, 27 Jun 2005 20:38:55 +0000 |
| Subject: | Can you serialize a Formbuilder object? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-19784@lists.php.net to get a copy of this message | ||
I am working on a multi-page wizard-like form using quickform controller,
with forms build by formbuilder. The benefits to this are easy to see, but
implementation is tricky. Currently stuck when it comes to processing the
forms with the line:
$page->process(array(&$fb, 'processForm'), false);
I am currently using serialize() on the formbuilder objects I create, then
adding them to an array of these serialized objects inside the $_SESSION
array. I do this because each page of the controller calls the php script
again and no formbuilder object can be stored in memory. Without the
serialize array, even if passed by reference, they therefore came back from
$_SESSION as __PHP_Incomplete_Class object type.
When they are unserialized, some of the objects inside this big formbuilder
object are __PHP_Incomplete_Class Object type, although the $fb itself is
now the appropriate DB_DataObject_FormBuilder type.
Please advise. Has this been tried before with success? Is it
theoretically possible to completely store and faithfully retrieve a
formbuilder object? -A