Epesi's QuickForm forms are rendered through Smarty too, using their own set of theme variables. This page covers how to lay out a form's fields, labels, and headers in a .tpl file.
QuickForm's labels, input fields, and headers for a given form are all exposed through one variable — an array, keyed by the form's identifier. By convention, that identifier is usually just form, which is why the examples below use {$form_open}, {$form_close}, and {$form_data...} — substitute your own identifier if you used something else.
To open the form's HTML tag:
{$form_open}
This also outputs the form's JS and its hidden fields. From here, you can place any of the form's fields and they'll be processed correctly.
Once you've placed all fields and headers, close the form:
{$form_close}
Note: to avoid a common mistake, open the form at the very start of the
.tplfile and place the closing statement at the very end — this only works if the file has just one form.
To access a field:
{$form_data.field_id.part_of_the_field}
Again, form here stands in for the form's identifier — replace it if yours is different.
Most fields you'll place in a template have three parts:
label — the field's label texthtml — the field's HTML code (the input tag)error — a span that's filled in with a validation error for that field, if anyFor example, a text input with id="name":
{$form_data.name.label}{$form_data.name.html}<br>
{$form_data.name.error}
Button and submit elements obviously don't have label or error parts.
Forms can also have a set of labels called headers, stored under {$form_data.header}. To access a specific header:
{$form_data.header.header_id}