Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The 'openOnly' and 'closeOnly' boolean options for the 'HtmlTag' decorator do exactly what you need to do. What openOnly means, as you can figure out, is that it only generates an opening tag (i.e. ) without the closing tag, and vice-versa for the closeOnly attribute (i.e. <p>Zend_Form PHP code:</p> <pre><code>$form = new Zend_Form(); // Form stuff here $form-&gt;addDisplayGroup( array( 'homeAddressLine1', 'homeAddressLine2', 'homeCity', // etc ), 'homeAddress', array( 'legend' =&gt; 'Home Address' 'disableDefaultDecorators' =&gt; true, 'decorators' =&gt; array( 'FormElements', 'FieldSet', array('HtmlTag', array('tag' =&gt; 'div', 'class' =&gt; 'addresses', 'openOnly' =&gt; true)) ) ) ); $form-&gt;addDisplayGroup( array( 'workAddressLine1', 'workAddressLine2', 'workCity', // etc ), 'workAddress', array( 'legend' =&gt; 'Work Address' 'disableDefaultDecorators' =&gt; true, 'decorators' =&gt; array( 'FormElements', 'FieldSet', array('HtmlTag', array('tag' =&gt; 'div', 'closeOnly' =&gt; true)) ) ) ); </code></pre> <p>Generated HTML:</p> <pre><code>&lt;form &lt;!-- Your Zend_Form attributes here --&gt;&gt; &lt;div class="addresses"&gt; &lt;fieldset id="fieldset-homeAddress"&gt; &lt;legend&gt;Home Address&lt;/legend&gt; &lt;!-- Your Home Address elements/decorators here --&gt; &lt;/fieldset&gt; &lt;fieldset id="fieldset-workAddress"&gt; &lt;legend&gt;Work Address&lt;/legend&gt; &lt;!-- Your Work Address elements/decorators here --&gt; &lt;/fieldset&gt; &lt;/div&gt; &lt;/form&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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