From 3de130c2da3b93a3404f264e92d7b65354de3548 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 7 Feb 2014 23:31:49 +0200 Subject: [ci skip] Add return types to helper docs (+ some other formatting) --- user_guide_src/source/helpers/form_helper.rst | 82 +++++++++++++++++---------- 1 file changed, 51 insertions(+), 31 deletions(-) (limited to 'user_guide_src/source/helpers/form_helper.rst') diff --git a/user_guide_src/source/helpers/form_helper.rst b/user_guide_src/source/helpers/form_helper.rst index dcb5bee21..4fa5f246b 100644 --- a/user_guide_src/source/helpers/form_helper.rst +++ b/user_guide_src/source/helpers/form_helper.rst @@ -30,7 +30,8 @@ The following functions are available: :param string $action: Form action/target URI string :param array $attributes: HTML attributes :param array $hidden: An array of hidden fields' definitions - :returns: string + :returns: An HTML form opening tag + :rtype: string Creates an opening form tag with a base URL **built from your config preferences**. It will optionally let you add form attributes and hidden input fields, and @@ -87,7 +88,8 @@ The following functions are available: :param string $action: Form action/target URI string :param array $attributes: HTML attributes :param array $hidden: An array of hidden fields' definitions - :returns: string + :returns: An HTML multipart form opening tag + :rtype: string This function is absolutely identical to :func:`form_open()` above, except that it adds a *multipart* attribute, which is necessary if you @@ -98,7 +100,8 @@ The following functions are available: :param string $name: Field name :param string $value: Field value - :returns: string + :returns: An HTML hidden input field tag + :rtype: string Lets you generate hidden input fields. You can either submit a name/value string to create one field:: @@ -159,13 +162,13 @@ The following functions are available: */ - .. function:: form_input([$data = ''[, $value = ''[, $extra = '']]) :param array $data: Field attributes data :param string $value: Field value :param string $extra: Extra attributes to be added to the tag *as is* - :returns: string + :returns: An HTML text input field tag + :rtype: string Lets you generate a standard text input field. You can minimally pass the field name and value in the first and second parameter:: @@ -198,13 +201,13 @@ The following functions are available: $js = 'onClick="some_function()"'; echo form_input('username', 'johndoe', $js); - .. function:: form_password([$data = ''[, $value = ''[, $extra = '']]]) :param array $data: Field attributes data :param string $value: Field value :param string $extra: Extra attributes to be added to the tag *as is* - :returns: string + :returns: An HTML password input field tag + :rtype: string This function is identical in all respects to the :func:`form_input()` function above except that it uses the "password" input type. @@ -215,7 +218,8 @@ The following functions are available: :param array $data: Field attributes data :param string $value: Field value :param string $extra: Extra attributes to be added to the tag *as is* - :returns: string + :returns: An HTML file upload input field tag + :rtype: string This function is identical in all respects to the :func:`form_input()` function above except that it uses the "file" input type, allowing it to @@ -227,7 +231,8 @@ The following functions are available: :param array $data: Field attributes data :param string $value: Field value :param string $extra: Extra attributes to be added to the tag *as is* - :returns: string + :returns: An HTML textarea tag + :rtype: string This function is identical in all respects to the :func:`form_input()` function above except that it generates a "textarea" type. @@ -235,14 +240,14 @@ The following functions are available: .. note:: Instead of the *maxlength* and *size* attributes in the above example, you will instead specify *rows* and *cols*. - .. function:: form_dropdown([$name = ''[, $options = array()[, $selected = array()[, $extra = '']]]]) :param string $name: Field name :param array $options: An associative array of options to be listed :param array $selected: List of fields to mark with the *selected* attribute :param string $extra: Extra attributes to be added to the tag *as is* - :returns: string + :returns: An HTML dropdown select field tag + :rtype: string Lets you create a standard drop-down field. The first parameter will contain the name of the field, the second parameter will contain an @@ -305,7 +310,8 @@ The following functions are available: :param array $options: An associative array of options to be listed :param array $selected: List of fields to mark with the *selected* attribute :param string $extra: Extra attributes to be added to the tag *as is* - :returns: string + :returns: An HTML dropdown multiselect field tag + :rtype: string Lets you create a standard multiselect field. The first parameter will contain the name of the field, the second parameter will contain an @@ -321,7 +327,8 @@ The following functions are available: :param string $legend_text: Text to put in the tag :param array $attributes: Attributes to be set on the
tag - :returns: string + :returns: An HTML fieldset opening tag + :rtype: string Lets you generate fieldset/legend fields. @@ -365,7 +372,9 @@ The following functions are available: .. function:: form_fieldset_close([$extra = '']) :param string $extra: Anything to append after the closing tag, *as is* - :returns: string + :returns: An HTML fieldset closing tag + :rtype: string + Produces a closing
tag. The only advantage to using this function is it permits you to pass data to it which will be added below @@ -384,7 +393,8 @@ The following functions are available: :param string $value: Field value :param bool $checked: Whether to mark the checkbox as being *checked* :param string $extra: Extra attributes to be added to the tag *as is* - :returns: string + :returns: An HTML checkbox input tag + :rtype: string Lets you generate a checkbox field. Simple example:: @@ -422,7 +432,8 @@ The following functions are available: :param string $value: Field value :param bool $checked: Whether to mark the radio button as being *checked* :param string $extra: Extra attributes to be added to the tag *as is* - :returns: string + :returns: An HTML radio input tag + :rtype: string This function is identical in all respects to the :func:`form_checkbox()` function above except that it uses the "radio" input type. @@ -433,7 +444,8 @@ The following functions are available: :param string $label_text: Text to put in the