Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To wrap your Contact form around <code>div</code> which is inside <code>&lt;li class ="af_title"&gt;</code> you can do as follows:</p> <pre><code>$yourForm = new YourForm(); $yourForm-&gt;addDecorator(array('div' =&gt; 'HtmlTag'), array('tag' =&gt; 'div')); $yourForm-&gt;addDecorator(array('li' =&gt; 'HtmlTag'), array('tag' =&gt; 'li', 'class' =&gt; 'af_title')); </code></pre> <p>EDIT:</p> <p>I see that you speak of div form element. Such element does not exist, but you could easily create it. For this you need two things: new form element (i.e. div element) and a form view helper that would take care of generation of the html. I allowed myself to prepare simple examples of these two elements to show what I mean:</p> <p><strong>Div.php in APPLICATION_PATH . /forms/Element</strong>:</p> <pre><code>class My_Form_Element_Div extends Zend_Form_Element { /** * Default form view helper to use for rendering * @var string */ public $helper = 'formDiv'; public function __construct($spec, $options = null) { parent::__construct($spec, $options); $this-&gt;removeDecorator('label'); $this-&gt;removeDecorator('htmlTag'); } } </code></pre> <p><strong>FormDiv.php in APPLICATION_PATH . /views/helpers</strong>:</p> <pre><code>class My_View_Helper_FormDiv extends Zend_View_Helper_FormElement { public function formDiv($name, $value = null, $attribs = null) { $class = ''; if (isset($attribs['class'])) { $class = 'class = "'. $attribs['class'] .'"'; } return "&lt;li $class&gt;&lt;div&gt;$value&lt;/div&gt;&lt;/li&gt;"; } } </code></pre> <p>Having this, you can just add the div form element to any form element in their init() method as follows:</p> <pre><code> $div = new My_Form_Element_Div('mydiv'); $div-&gt;setValue('Contact form')-&gt;setAttrib('class', 'af_title'); $this-&gt;addElement($div); </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.
 

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