PEAR HTML_QuickForm2: how to return a saved session container to a form

I use a controller to create a multi-page form. I save the submitted and unauthorized application data in the database field:

$serialized_data = $oCon->dbConn->real_escape_string( serialize($ctrl->getSessionContainer()) ); $oCon->dbConn->query( "INSERT INTO form_data SET (data) VALUES ('" . $serialized_data . "')" ); 

This works fine, but how do I return a saved object to the session for incomplete records?
Return only the return values ​​when saving them to the database field using getValue() and

 $ctrl->addDataSource(new HTML_QuickForm2_DataSource_Array($unserialized_data)); 

but I need the whole object and with a valid array of pages.

I believe the answer lies in this page , but I could not get it to work with any combination of storeDataSources() , addDataSource() and setDataSources() . It seems that the setSessionContainer() method is missing.

This is my first question on this forum, I tried to follow all the rules, please correct me if I make stupid mistakes or if this is a stupid question.

+4
source share
1 answer

I think you misunderstand how to use Quickform2. If you need to work with a multi-page form, you want to use the QuickformController: http://pear.php.net/manual/en/package.html.html-quickform2.controller-overview.php

0
source

Source: https://habr.com/ru/post/1439761/


All Articles