There's a few ways. You can roll your own element view helpers (which could get rather clumsy soon I guess).
Or... you could use a viewscript for the form, like this (very basic example):
class Your_Form extends Zend_Form
{
public function init()
{
$this->setDecorators( array(
'PrepareElements',
array( 'ViewScript', array( 'viewScript' => 'path/to/viewscript.phtml' ) )
) );
// only use basic decorators for elements
$decorators = array(
'ViewHelper',
'Label',
'Errors'
);
// create some element
$someElement = new Zend_Form_Element_Text( 'someElement' );
// set the basic decorators for this element and set a css class
$someElement->setDecorators( $decorators )
->setAttrib( 'class', 'someCssClass' );
// add (potentially multiple) elements to this from
$this->addElements( array(
$someElement
) );
}
}
See the standard decorators section about PrepareElements for why it's needed to have the PrepareElements decorator set for the form, when using the ViewScript decorator.
Then in the viewscript:
<?
// the form is available to the viewscript as $this->element
$form = $this->element;
?>
<!-- put whatever html you like in this script and render the basic element decorators seperately -->
<div>
<? if( $form->someElement->hasErrors() ): ?>
<?= $form->someElement->renderErrors() ?>
<? endif; ?>
<?= $form->someElement->renderLabel(); ?>
<?= $form->someElement->renderViewHelper(); ?>
</div>