|stash||The stash used for the template processing. Additional information is added to this stash automatically during field and form processing.|
|css_prefix||This is applied to all html element CSS ids and class names. By default, css_prefix is set to fs_|
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
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.
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:
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 Template WRAPPER 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:
For more information on render_hints, see Form::Sensible::Overview.
Note that wrap_fields_with has been deprecated and will be removed in a future release.
|status_messages||An array ref containing the status messages to be displayed on the form.|
|error_messages||An array ref containing the error messages to be displayed on the form.|
|form_template_prefix||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.|
|subform_renderers has||This contains the references to subform renderers. Subform rendering is experimental and is still subject to changes. Its probably best to leave this attribute alone for now.|
|form||A reference to the form object that is being rendered.|
|template||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 youve read the source, its a good idea to leave this alone.|
|template_fallback_order||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.|
add_status_message($message) Adds $message to the status messages to be displayed. add_error_message($fieldname, $message) Adds the error message provided in $message to the list of error messages to be displayed. The error message is associated with the $fieldname given. add_errors_from_validator_result($validator_result) Inspects $validator_result and adds any messages found to the list of errors to be displayed on the form. start($action, $method) 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. messages() This renders the messages portion of the form. Often (and by default) this is displayed before the form fields. Returns the rendered messages html as a string. render_field($fieldname, $render_hints) 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. fields($manual_hints) A shortcut routine that renders all the fields in the form. Returns all of the fields rendered as a single string. end sub Renders the end of the form. Returns the rendered html as a string. fieldnames() Returns an array containing the fieldnames in the form (in their render order) complete($action, $method, $manual_hints) Renders the entire form and returns the rendered results. Calling <$form-complete($action, $method) >> routine is functionally equivalent to calling:
$form->start($action, $method) . $form->messages() . $form->fields() . $form->end();
display_name_delegate: ($caller, $display_name, $field_or_form_object) 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.
Jay Kuri - <email@example.com>
Ionzero LLC. <http://ionzero.com/>
Copyright 2009 by Jay Kuri <firstname.lastname@example.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|perl v5.20.3||FORM::SENSIBLE::RENDERER::HTML::RENDEREDFORM (3)||2012-02-02|