Home » HTML » HTML_QuickForm » Bug #6660
Added arraySmarty functionality setDefaultLabelTemplate
Details
| Request #6660 | Added arraySmarty functionality setDefaultLabelTemplate |
|---|---|
| Submitted | 2006-02-01 20:38 UTC |
| From | dslieker at gmail dot com |
| Status | Wont fix |
| Package | HTML_QuickForm |
| PHP Version | Irrelevant |
| 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.