Issues

ZF-5962: Zend_View_Helper_FormErrors does not allow custom HTML directly from formErrors()

Description

Zend_View_Helper_FormErrors, when invoked by Zend_Form_Decorator_Errors, does not provide a way for you to customize the HTML tags used. Any customizations require set*() calls, which Zend_Form_Decorator_Errors does not perform. There is no way to set the HTML variables using the $options array.

I am attaching a patch that fixes this, by passing elementStart, elementEnd, and elementSeparator options on to the corresponding set*() calls. With these changes, one can customize the HTML tags by setting the appropriate options from within Zend_Form_Decorator_Errors.

Comments

Currently you need to call in the view php like the following.


$formErrors = $this->getHelper('formErrors');
/* @var $formErrors Zend_View_Helper_FormErrors */
$formErrors->setElementStart('
'); $formErrors->setElementSeparator(''); $formErrors->setElementEnd('
');

Or any better way?

Unit test added.

Fixed on trunk (25206) and release-1.12 (25207)

Thanks to Alex!