tml_register_form()

Register a TML form.

Description

Theme_My_Login_Form tml_register_form( mixed $form [, array $args ] )

Register a form for use within TML. Note that in order for a form to be used with an action, the form name must match the action name.

Parameters

form

Can either be a string to be used for the form name or a Theme_My_Login_Form object.

args

An array of arguments used for registering a form. This parameter is only used if the form parameter is a string. Acceptable arguments are as follows:

  • string action
    The form action. That is, the URL to which the form should be submitted. Default is empty.
  • string method
    The form method. Default is 'post'.
  • array render_args
    An array of arguments used for rendering the form. Acceptable arguments are as follows:
    • string container
      The element to be used as a container for the form. Set to false to disable the container. Default is 'div'.
    • string container_class
      The CSS class to be applied to the container, if container is not empty. Use %s as a placeholder for the form name. Default is 'tml tml-%s'.
    • string container_id
      The ID to be applied to the container, if container is not empty. Default is empty.
    • string before
      Content to be rendered before the form. Default is empty.
    • string after
      Content to be rendered after the form. Default is empty.
    • bool show_links
      Whether to show links to other actions on this form or not. Default is true.

Return Values

Returns a Theme_My_Login_Form instance.

Examples

Example #1 Registering a form using an array

tml_register_form( 'foo', array(
	'action' => tml_get_action_url( 'foo' ),
	'method' => 'post',
) );

See Also

tml_add_form_field() - Add a field to a TML form