PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTML » HTML_QuickForm » Bug #6660

Added arraySmarty functionality setDefaultLabelTemplate

Details

Request #6660Added arraySmarty functionality setDefaultLabelTemplate
Submitted2006-02-01 20:38 UTC
Fromdslieker at gmail dot com
StatusWont fix
PackageHTML_QuickForm
PHP VersionIrrelevant
Roadmaps(Not assigned)

Comments

[2006-02-01 20:38 UTC] dslieker at gmail dot com

Description:
------------
The current arraySmarty renderer allows you to customize the display output if there is an error, or if the field is required, however, it is currently not possible through API to customize the look of labels in the event that the field is not required, and produced no errors. I have added this functionality through the method setDefaultLabelTemplate and the private method _renderDefaultLabel.

Test script:
---------------
http://www.imaspy.com/quickFormAddition/ArraySmarty.txt

$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($this->smarty);

$renderer->setDefaultLabelTemplate('<span class="formLabel">{$label}</span>');

// build the HTML for the form
$formObject->accept($renderer);

Expected result:
----------------
the string sent via the method setDefaultLabelTemplate will be used as the default template for labels when there are no errors, and the field is not required.