I've created a composite form but the problem is that it doesn't send attribs to my rendered form.
class My_View_Helper_NameElement extends Zend_View_Helper_FormElement { protected $xhtml = ''; public function nameElement($name, $value = null, $attribs= null) { $helper = new Zend_View_Helper_FormText(); $helper->setView($this->view); $this->xhtml .= $helper->formText($name . '[first_name]', '', array()); $this->xhtml .= $helper->formText($name . '[last_name]', '', array()); return $this->xhtml; } }setAttrib in following code doesn't send the class
$this->xhtml .= $helper->formText($name . '[first_name]', '', array(); $this->xhtml .= $helper->formText($name . '[last_name]', '', array());
<dt id="name-label"> <label for="name" class="required">Name:</label> </dt> <dd id="name-element"> <input type="text" name="name[first_name]" id="name-first_name" value=""> <input type="text" name="name[last_name]" id="name-last_name" value=""> </dd>
– eneepo<dt id="name-label"> <label for="name" class="required">Name:</label> </dt> <dd id="name-element"> <input type="text" name="name[first_name]" id="name-first_name" value="" class="text mini"> <input type="text" name="name[last_name]" id="name-last_name" value="" class="text mini"> </dd>
it doesn't render class='text mini' – eneepo