I’m using Zend Framework and Zend_Form to render my form. But as I found it hard to customize it, I decided to print elements individually.
Problem is, I don’t know how to print individual elements inside a display group. I know how to print my display groups (fieldsets) but I need to add something inside it (like a <div class="spacer"></div> to cancel the float:left.
Is there any way to display the group only without its content so I can print them individually myself?
Thank you for your help.
What you are looking for is the ‘ViewScript’ decorator. It allows you to form your html in any way you need. Here is a simple example of how it works:
The form, a simple search form:
Next is the ‘partial’ this is the decorator, here is where you build the html how you want it:
and finally the controller code:
display this form in your view script with the normal
<?php $this->form ?>.You can use this method for any form you want to build with Zend_Form. So adding any element to your own fieldset would be simple.