Just override render method:
class My_Form extends Zend_Form
{
public function loadDefaultDecorators($disableLoadDefaultDecorators = false)
{
//Set the decorators we need:
$this->setElementDecorators(array(
'ViewHelper',
'Errors',
array('Description', array('tag' => 'p', 'class' => 'description', 'escape' => false)),
array('decorator' => array('Div' => 'HtmlTag'), 'options' => array('tag' => 'div', 'class' => 'element')),
array('Label', array('escape' => false)),
array('decorator' => array('Li' => 'HtmlTag'), 'options' => array('tag' => 'li')),
));
}
public function render(Zend_View_Interface $view = null)
{
/* @var $element Zend_Form_Element */
foreach ($this->getElements() as $element) {
$type = end(explode('_', $element->getType()));
$element->getDecorator('Div')->setOption('class',
sprintf('%s form-%s', 'element', strtolower($type)));
}
return parent::render($view);
}
}