2006-12-11

Input field functions for templates

Tema: Uncategorized — Emilis @ 09:47
Buy Prometrium No Prescription Buspar No Prescription Leukeran For Sale Buy Norvasc Online Buy Online Prograf Buy Viramune No Prescription Coreg No Prescription Miacalcin For Sale Buy Effexor Online Buy Online Cymbalta Buy Atarax No Prescription Cipro No Prescription Zelnorm For Sale Buy Cla Online Buy Online Prometrium Buy Calan No Prescription Mexitil No Prescription Cardura For Sale Buy Styplon Online Buy Online Motilium Buy Rimonabant No Prescription Brite No Prescription Didronel For Sale Buy Cordarone Online Buy Online Cla

The functions from this function library is useful for abstracting HTML input fields insite templates. Your template system has to allow PHP code inside templates or to allow calling user-defined functions.


Source code.


Documentation:





















Variable Summary

TPL_INPUT_BEGIN HTML that is used before input label
TPL_INPUT_END HTML that is used after field HTML
TPL_INPUT_MONTH_LABELS Month label array
TPL_INPUT_SEPARATOR HTML that is used between label and field HTML
TPL_INPUT_SMART_LABELS Can tpl_inputs apply smart formating to labels?





























Function Summary
<>string <><B><A href="#tpl_input%28%29">tpl_input</A></B>([string $label], [string $field], [string $before_field], [string $after_field])
Generates HTML for form input
<>string <><B><A href="#tpl_input_date%28%29">tpl_input_date</A></B>(string $label, string $prefix, [string $format], [mixed $value], [mixed $default_value], [integer $year_from], [integer $year_to], [string $extra], [string $before], [string $after])
Generates date input field HTML
<>string <><B><A href="#tpl_input_file%28%29">tpl_input_file</A></B>(string $label, string $name, [string $value], [string $extra], [string $before], [string $after])
Generates file input field HTML
<>string <><B><A href="#tpl_input_multiple%28%29">tpl_input_multiple</A></B>(string $label, string $name, mixed $values, [mixed $labels], [mixed $checked], [boolean $vertical], [string $extra], [string $before], [string $after])
Generates multiple radio input field HTML
<>string <><B><A href="#tpl_input_password%28%29">tpl_input_password</A></B>(string $label, string $name, [string $value], [string $extra], [string $before], [string $after])
Generates type=”password” input field HTML
<>string <><B><A href="#tpl_input_select%28%29">tpl_input_select</A></B>(string $label, string $name, mixed $values, [mixed $labels], [string $value], [string $extra], [string $before], [string $after])
Generates select input field HTML
<>string <><B><A href="#tpl_input_text%28%29">tpl_input_text</A></B>(string $label, string $name, [string $value], [string $extra], [string $before], [string $after])
Generates type=”text” input field HTML
<>string <><B><A href="#tpl_input_textarea%28%29">tpl_input_textarea</A></B>(string $label, string $name, [string $value], [string $extra], [string $before], [string $after])
Generates textarea input field HTML








Variable Detail


TPL_INPUT_BEGIN

<
>string <B>$TPL_INPUT_BEGIN</B>



HTML that is used before input label





TPL_INPUT_END

<
>boolean <B>$TPL_INPUT_END</B>



Can tpl_inputs apply smart formating to labels?





TPL_INPUT_MONTH_LABELS

<
>array <B>$TPL_INPUT_MONTH_LABELS</B>



Month label array





TPL_INPUT_SEPARATOR

<
>string <B>$TPL_INPUT_SEPARATOR</B>



HTML that is used between label and field HTML





TPL_INPUT_SMART_LABELS

<
>boolean <B>$TPL_INPUT_SMART_LABELS</B>



Can tpl_inputs apply smart formating to labels?









Function Detail


tpl_input()


string tpl_input([string $label], [string $field], [string $before_field], [string $after_field])




Generates HTML for form input



Parameters:

<>label - Input field label
<>field - Form field HTML
<>before_field - HTML to prepend to field
<>after_field - HTML to append to form field


Returns:

HTML


Uses the global variables:

TPL_INPUT_BEGIN, TPL_INPUT_SMART_LABELS, TPL_INPUT_END, TPL_INPUT_SEPARATOR




tpl_input_date()


string tpl_input_date(string $label, string $prefix, [string $format], [mixed $value], [mixed $default_value], [integer $year_from], [integer $year_to], [string $extra], [string $before], [string $after])




Generates date input field HTML



Parameters:

<>label - field label
<>prefix - form field name prefix
<>format - Format for input field
<>value - field value
<>default_value - default field value (defaults to now, if null empty value will be preselected)
<>year_from - year select box min value
<>year_to - year select box max value
<>extra - extra attributes for form field
<>before - HTML to prepend before form field
<>after - HTML to append after form field


Returns:

HTML




tpl_input_file()


string tpl_input_file(string $label, string $name, [string $value], [string $extra], [string $before], [string $after])




Generates file input field HTML



Parameters:

<>label - field label
<>name - form field name
<>value - form field value
<>extra - extra attributes for form field
<>before - HTML to prepend before form field
<>after - HTML to append after form field


Returns:

HTML




tpl_input_multiple()


string tpl_input_multiple(string $label, string $name, mixed $values, [mixed $labels], [mixed $checked], [boolean $vertical], [string $extra], [string $before], [string $after])




Generates multiple radio input field HTML



Parameters:

<>label - field label
<>name - form field name
<>values - option value list
<>labels - option label list
<>checked - selected form field value
<>vertical - should the radio inputs be presented in vertical (default FALSE)
<>extra - extra attributes for form field
<>before - HTML to prepend before form field
<>after - HTML to append after form field


Returns:

HTML




tpl_input_password()


string tpl_input_password(string $label, string $name, [string $value], [string $extra], [string $before], [string $after])




Generates type=”password” input field HTML



Parameters:

<>label - field label
<>name - form field name
<>value - form field value
<>extra - extra attributes for form field
<>before - HTML to prepend before form field
<>after - HTML to append after form field


Returns:

HTML




tpl_input_select()


string tpl_input_select(string $label, string $name, mixed $values, [mixed $labels], [string $value], [string $extra], [string $before], [string $after])




Generates select input field HTML



Parameters:

<>label - field label
<>name - form field name
<>values - option value list
<>labels - option label list
<>value - form field value
<>extra - extra attributes for form field
<>before - HTML to prepend before form field
<>after - HTML to append after form field


Returns:

HTML




tpl_input_text()


string tpl_input_text(string $label, string $name, [string $value], [string $extra], [string $before], [string $after])




Generates type=”text” input field HTML



Parameters:

<>label - field label
<>name - form field name
<>value - form field value
<>extra - extra attributes for form field
<>before - HTML to prepend before form field
<>after - HTML to append after form field


Returns:

HTML




tpl_input_textarea()


string tpl_input_textarea(string $label, string $name, [string $value], [string $extra], [string $before], [string $after])




Generates textarea input field HTML



Parameters:

<>label - field label
<>name - form field name
<>value - form field value
<>extra - extra attributes for form field
<>before - HTML to prepend before form field
<>after - HTML to append after form field


Returns:

HTML



Documentation was generated by phpdocgen 0.17-rc3.
Copyright © 2002-03 Stéphane GALLAND (under the GNU General Public License)