The Form::Sensible::Renderer::HTML::RenderedForm class defines the result of rendering a form as HTML. It is not generally created directly, but rather is created by passing a form to the Form::Sensible::Renderer::HTMLrender() mathod.

Render hints provide information on how to render certain aspects of the form or field. The usage depends upon the field type in question. The information is passed through to the field-specific templates as 'render_hints' during processing.

A hint that is specific to the HTML renderer is stash_vars, this should be a hash and will be passed to the templates as they are rendered.

{
stash_vars => {
user_prefs => $user_prefs
}
}

For example in the this case, $user_prefs could be accessed in any of the templates (form_start.tt, text.tt etc) as [% user_prefs %].

Another is field_wrapper which should be the name of a template to act as a wrapper for each individual field template. This can be useful if each field has common HTML and only the actual field element changes. For example in this case:

{
field_wrapper => 'field_wrapper_file'
}

A template called field_wrapper_file.tt will be used. The field_wrapper hint overrides the built-in wrapper, so only the actual input field will be available and you will need to provide any enclosing elements or labels. Note also that it uses the standard TemplateWRAPPER mechanism. Thus the field wrapper template will be rendered, and the actual input elements will be available as [% content %] within your wrapper template. So your wrapper template might end up looking like:

Non-field related template names are prefixed with this value. The three templates used for each form are: start, messages, and end, The default value for form_template_prefix is 'form', so by default the form templates used are: form_start.tt,form_messages.tt, and form_end.tt.

The template toolkit object to be used to process the templates. This is normally set up prior to rendering and should only be changed if you know what you are doing. In other words, unless you've read the source, it's a good idea to leave this alone.

An array ref containing the order to seek for overriding templates for all elements of form rendering. By default, a subdirectory named after the $form->name is searched first, then the root template directory is searched.

This renders the start of the form and sets it to be submitted to the url provided in $action. $action is placed directly in to the action attribute of the form element. Returns the rendered HTML as a string.

Renders the field matching $fieldname and returns the rendered HTML for the field. If the $render_hints hashref is provided, it will be merged into any previously set render hints for the field. When a key conflict occurs the passed $render_hints will override any existing configuration.

The display_name_delegate provides a hook to allow for localization of form and field names. It is passed the field or form name as well as the field or form object and is expected to return the translated name. It is important to return a value. If you are unable to translate the name, returning the passed name unchanged is encouraged.