HTML_QuickForm_Renderer_ArraySmarty::setRequiredTemplate() – Sets the way required elements are rendered


require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';

void HTML_QuickForm_Renderer_ArraySmarty::setRequiredTemplate ( string $template )


You can use {$label} or {$html} placeholders to let the renderer know where where the element label or the element html are positionned according to the required tag. They will be replaced accordingly with the right value. You can use the full smarty syntax here, especially a custom modifier for I18N. For example: {if $required}<span style="color: red;">*</span>{/if}{$label|translate} will put a red star in front of the label if the element is required and translate the label.


string $template

The required element template


throws no exceptions thrown


This function can not be called statically.

Sets the way elements with validation errors are rendered (Previous) Dynamic renderer for Integrated Templates (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.