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.
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 |
tpl_input([string $label], [string $field], [string $before_field], [string $after_field])Generates HTML for form input |
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 |
string |
tpl_input_file(string $label, string $name, [string $value], [string $extra], [string $before], [string $after])Generates file input field HTML |
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 |
string |
tpl_input_password(string $label, string $name, [string $value], [string $extra], [string $before], [string $after])Generates type=”password” input field HTML |
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 |
string |
tpl_input_text(string $label, string $name, [string $value], [string $extra], [string $before], [string $after])Generates type=”text” input field HTML |
string |
tpl_input_textarea(string $label, string $name, [string $value], [string $extra], [string $before], [string $after])Generates textarea input field HTML |
| Variable Detail |
TPL_INPUT_BEGIN
string $TPL_INPUT_BEGIN
-
HTML that is used before input label
TPL_INPUT_END
boolean $TPL_INPUT_END
-
Can tpl_inputs apply smart formating to labels?
TPL_INPUT_MONTH_LABELS
array $TPL_INPUT_MONTH_LABELS
-
Month label array
TPL_INPUT_SEPARATOR
string $TPL_INPUT_SEPARATOR
-
HTML that is used between label and field HTML
TPL_INPUT_SMART_LABELS
boolean $TPL_INPUT_SMART_LABELS
-
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 labelfield– Form field HTMLbefore_field– HTML to prepend to fieldafter_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 labelprefix– form field name prefixformat– Format for input fieldvalue– field valuedefault_value– default field value (defaults to now, if null empty value will be preselected)year_from– year select box min valueyear_to– year select box max valueextra– extra attributes for form fieldbefore– HTML to prepend before form fieldafter– 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 labelname– form field namevalue– form field valueextra– extra attributes for form fieldbefore– HTML to prepend before form fieldafter– 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 labelname– form field namevalues– option value listlabels– option label listchecked– selected form field valuevertical– should the radio inputs be presented in vertical (default FALSE)extra– extra attributes for form fieldbefore– HTML to prepend before form fieldafter– 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 labelname– form field namevalue– form field valueextra– extra attributes for form fieldbefore– HTML to prepend before form fieldafter– 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 labelname– form field namevalues– option value listlabels– option label listvalue– form field valueextra– extra attributes for form fieldbefore– HTML to prepend before form fieldafter– 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 labelname– form field namevalue– form field valueextra– extra attributes for form fieldbefore– HTML to prepend before form fieldafter– 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 labelname– form field namevalue– form field valueextra– extra attributes for form fieldbefore– HTML to prepend before form fieldafter– 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)