Note that there are some explanatory texts on larger screens.

plurals
  1. POSaving zend sub_form into session variable
    text
    copied!<p>Hello i've ran into a problem with zend framework. I want to make a multi-step form with zend but this isn't supported by zend, so can i save sub_form in session variables and validate them one by one and then at the end of the main form take all of sub_form to display all the form ?</p> <p>Thanks in advance for your help !</p> <p>Here is my forms code :</p> <pre><code> public function init() { /* Form Elements &amp; Other Definitions Here ... */ $this-&gt;setAttrib("class", "form-horizontal well"); $name = $this-&gt;createElement('text', 'name', array( "label" =&gt; $this-&gt;getTranslator()-&gt;translate('ADD_NAME'), "description" =&gt; $this-&gt;getTranslator()-&gt;translate('ADD_EXAMPLE_NAME') ))-&gt;setRequired(true); $trigram = $this-&gt;createElement('text', 'trigram', array( "label" =&gt; $this-&gt;getTranslator()-&gt;translate('ADD_TRIGRAM'), "description" =&gt; $this-&gt;getTranslator()-&gt;translate('ADD_EXAMPLE_TRIGRAM') ))-&gt;setRequired(true); $environment = $this-&gt;createElement('select', 'environment', array( "label" =&gt; $this-&gt;getTranslator()-&gt;translate('ADD_ENVIRONMENT') ))-&gt;setRequired(true); $url_clientsite = $this-&gt;createElement('text', 'url_clientsite', array( "label" =&gt; $this-&gt;getTranslator()-&gt;translate('ADD_URL_CLIENT'), "description" =&gt; $this-&gt;getTranslator()-&gt;translate('ADD_EXAMPLE_URL') ))-&gt;setRequired(true); $check_box = $this-&gt;createElement('multicheckbox', 'components', array( "multiOptions" =&gt; array( "mon" =&gt; " BDD Mona", "sta" =&gt; " BDD Stats", "log" =&gt; " BDD Logs", "sal" =&gt; " Sali", "agg" =&gt; " StatsAggregator", "etl" =&gt; " ETL", "jvs" =&gt; " JavaScript", "adm" =&gt; " Admin" )))-&gt;setRequired(true); $step_1 = new Zend_Form_SubForm(); $step_1-&gt;addElements(array( $name, $trigram, $environment, $url_clientsite, )); $this-&gt;addSubForm($step_1, 'step1'); $step_2 = new Zend_Form_SubForm(); $step_2-&gt;addElement($check_box); $this-&gt;addSubForm($step_2, 'step2'); $step_3 = new Zend_Form_SubForm(); $step_3-&gt;addElements(); $this-&gt;addSubForm($step_3, 'step3'); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload