Issues

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

Issue Type: Improvement Created: 2009-03-06T21:45:18.000+0000 Last Updated: 2013-01-10T11:36:55.000+0000 Status: Resolved Fix version(s): - 1.12.2 (25/Feb/13)

Reporter: Alex Adriaanse (alexadriaanse) Assignee: Frank Brückner (frosch) Tags: - Zend_View

  • FixForZF1.12.1

Related issues: Attachments: - FormErrorsTest.php.patch

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

Posted by twk (twk) on 2009-08-22T08:01:59.000+0000

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

<pre class="highlight">
$formErrors = $this->getHelper('formErrors');
/* @var $formErrors Zend_View_Helper_FormErrors */
$formErrors->setElementStart('

<span>');
$formErrors->setElementSeparator('</span><span>');
$formErrors->setElementEnd('</span>


');

Or any better way?

Posted by Frank Brückner (frosch) on 2012-09-26T10:09:38.000+0000

Unit test added.

Posted by Frank Brückner (frosch) on 2013-01-10T11:36:54.000+0000

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

Thanks to Alex!

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts