Prints
static void
displayBlank
()
Prints a blank row in the table
static void
displayBlankRow
(int $i, [string $title = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
int
$i: the number of rows to create. Ignored if $title is used.
-
string
$title: a string to be used as the label for the row
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Prints a checkbox input
static void
displayCheckbox
(string $name, [bool $default = false], [string $attr = ''])
-
string
$name: the string used in the 'name' attribute
-
bool
$default: a bool indicating if item should be checked
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Prints a checkbox input inside a table row
static void
displayCheckboxRow
(string $name, string $title, [bool $default = false], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
bool
$default: a bool indicating if item should be checked
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Prints a file upload input
static void
displayFile
(string $name, [int $maxsize = HTML_FORM_MAX_FILE_SIZE], [int $size = HTML_FORM_TEXT_SIZE], [string $accept = ''], [string $attr = ''])
-
string
$name: the string used in the 'name' attribute
-
int
$maxsize: an integer determining how large (in bytes) a submitted file can be.
-
int
$size: an integer used in the 'size' attribute
-
string
$accept: a string saying which MIME types are allowed
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Prints a file upload input inside a table row
static void
displayFileRow
(string $name, string $title, [int $maxsize = HTML_FORM_MAX_FILE_SIZE], [int $size = HTML_FORM_TEXT_SIZE], [string $accept = ''], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
int
$maxsize: an integer determining how large (in bytes) a submitted file can be.
-
int
$size: an integer used in the 'size' attribute
-
string
$accept: a string saying which MIME types are allowed
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Prints a hiden input
static void
displayHidden
(string $name, string $value, [string $attr = ''])
-
string
$name: the string used in the 'name' attribute
-
string
$value: the string used for the item's value
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Prints an image input
static void
displayImage
(string $name, string $src, [string $attr = ''])
-
string
$name: the string used in the 'name' attribute
-
string
$src: the string denoting the path to the image. Can be a relative path or full URI.
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Prints an image input inside a table row
static void
displayImageRow
(string $name, string $title, string $src, [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
string
$src: the string denoting the path to the image. Can be a relative path or full URI.
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Prints a password input
static void
displayPassword
(string $name, [mixed $default = null], [int $size = HTML_FORM_PASSWD_SIZE], [int $maxlength = 0], [string $attr = ''])
-
string
$name: the string used in the 'name' attribute
-
mixed
$default: a default value for the element
-
int
$size: an integer used in the 'size' attribute
-
int
$maxlength: an integer used in the 'maxlength' attribute
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Prints a password input inside a table row
static void
displayPasswordOneRow
(string $name, string $title, [mixed $default = null], [int $size = HTML_FORM_PASSWD_SIZE], [int $maxlength = 0], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
mixed
$default: a default value for the element
-
int
$size: an integer used in the 'size' attribute
-
int
$maxlength: an integer used in the 'maxlength' attribute
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Prints a combined password input and password confirmation input inside a table row
static void
displayPasswordRow
(string $name, string $title, [mixed $default = null], [int $size = HTML_FORM_PASSWD_SIZE], [int $maxlength = 0], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
mixed
$default: a default value for the element
-
int
$size: an integer used in the 'size' attribute
-
int
$maxlength: an integer used in the 'maxlength' attribute
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Prints the text provided
static void
displayPlaintext
([string $text = ' '])
-
string
$text: a string to be displayed
Prints the text provided inside a table row
static void
displayPlaintextRow
(string $title, [string $text = ' '], [string $thattr = 'align="right valign="top""'], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$title: the string used as the label
-
string
$text: a string to be displayed
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Prints a radio input
static void
displayRadio
(string $name, string $value, [bool $default = false], [string $attr = ''])
-
string
$name: the string used in the 'name' attribute
-
string
$value: the string used for the item's value
-
bool
$default: a bool indicating if item should be checked
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Prints a radio input inside a table row
static void
displayRadioRow
(string $name, string $title, string $value, [bool $default = false], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
string
$value: the string used for the item's value
-
bool
$default: a bool indicating if item should be checked
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Prints a reset button
NOTE: Unusual parameter order.
static void
displayReset
([string $title = 'Clear contents'], [string $attr = ''])
-
string
$title: a string that appears on the button
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Prints a reset button inside a table row
NOTE: Unusual parameter order.
static void
displayResetRow
([string $title = 'Clear contents'], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$title: a string that appears on the button
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Prints a select list
NOTE: In order for defaults to be automatically selected in the output, the PHP data types of the $default must match the data types of the keys in the $entries array.
static void
displaySelect
(string $name, array $entries, [mixed $default = null], [int $size = 1], [string $blank = ''], [bool $multiple = false], [string $attr = ''])
-
string
$name: the string used in the 'name' attribute
-
array
$entries: an array containing the <options> to be listed. The array's keys become the option values and the array's values become the visible text.
-
mixed
$default: a default value for the element
-
int
$size: an integer saying how many rows should be
-
string
$blank: if this string is present, an <option> will be added to the top of the list that will contain the given text in the visible portion and an empty string as the value
-
bool
$multiple: a bool saying if multiple choices are allowed
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Prints a select list inside a table row
NOTE: In order for defaults to be automatically selected in the output, the PHP data types of the $default must match the data types of the keys in the $entries array.
static void
displaySelectRow
(string $name, string $title, array $entries, [mixed $default = null], [int $size = 1], [string $blank = ''], [bool $multiple = false], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
array
$entries: an array containing the <options> to be listed. The array's keys become the option values and the array's values become the visible text.
-
mixed
$default: a default value for the element
-
int
$size: an integer saying how many rows should be
-
string
$blank: if this string is present, an <option> will be added to the top of the list that will contain the given text in the visible portion and an empty string as the value
-
bool
$multiple: a bool saying if multiple choices are allowed
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Prints a submit button
NOTE: Unusual parameter order.
static void
displaySubmit
([string $title = 'Submit Changes'], [string $name = 'submit'], [string $attr = ''])
-
string
$title: a string that appears on the button
-
string
$name: a string used in the 'name' attribute
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Prints a submit button inside a table row
static void
displaySubmitRow
([string $name = 'submit'], [string $title = 'Submit Changes'], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: a string used in the 'name' attribute
-
string
$title: a string that appears on the button
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Prints a text input element
static void
displayText
(string $name, [mixed $default = null], [int $size = HTML_FORM_TEXT_SIZE], [int $maxlength = 0], [string $attr = ''])
-
string
$name: the string used in the 'name' attribute
-
mixed
$default: a default value for the element
-
int
$size: an integer used in the 'size' attribute
-
int
$maxlength: an integer used in the 'maxlength' attribute
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Prints a textarea input
static void
displayTextarea
(string $name, [mixed $default = null], [int $width = 40], [int $height = 5], [int $maxlength = ''], [string $attr = ''])
-
string
$name: the string used in the 'name' attribute
-
mixed
$default: a default value for the element
-
int
$width: an integer saying how many characters wide the item should be
-
int
$height: an integer saying how many rows tall the item should be
-
int
$maxlength: an integer used in the 'maxlength' attribute
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Prints a textarea input inside a table row
static void
displayTextareaRow
(string $name, string $title, [mixed $default = null], [int $width = 40], [int $height = 5], [int $maxlength = 0], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
mixed
$default: a default value for the element
-
int
$width: an integer saying how many characters wide the item should be
-
int
$height: an integer saying how many rows tall the item should be
-
int
$maxlength: an integer used in the 'maxlength' attribute
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Prints a text input element inside a table row
static void
displayTextRow
(string $name, string $title, [mixed $default = null], [int $size = HTML_FORM_TEXT_SIZE], [int $maxlength = 0], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
mixed
$default: a default value for the element
-
int
$size: an integer used in the 'size' attribute
-
int
$maxlength: an integer used in the 'maxlength' attribute
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Produce a string containing
static string
returnBlank
()
Produce a string containing a blank row in the table
static string
returnBlankRow
(int $i, [string $title = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
int
$i: the number of rows to create. Ignored if $title is used.
-
string
$title: a string to be used as the label for the row
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Produce a string containing a checkbox input
static string
returnCheckbox
(string $name, [bool $default = false], [string $attr = ''])
-
string
$name: the string used in the 'name' attribute
-
bool
$default: a bool indicating if item should be checked
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Produce a string containing a checkbox input inside a table row
static string
returnCheckboxRow
(string $name, string $title, [bool $default = false], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
bool
$default: a bool indicating if item should be checked
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Produce a string containing a text input with a jquery datePicker
static string
returnDatepicker
(string $name, [mixed $default = null], [int $size = HTML_FORM_TEXT_SIZE], [int $maxlength = 0], [string $attr = ''])
-
string
$name: the string used in the 'name' attribute
-
mixed
$default: a default value for the element
-
int
$size: an integer used in the 'size' attribute
-
int
$maxlength: an integer used in the 'maxlength' attribute
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Produce a string containing a file upload input
static string
returnFile
([string $name = 'userfile'], [int $maxsize = HTML_FORM_MAX_FILE_SIZE], [int $size = HTML_FORM_TEXT_SIZE], [string $accept = ''], [string $attr = ''])
-
string
$name: the string used in the 'name' attribute
-
int
$maxsize: an integer determining how large (in bytes) a submitted file can be.
-
int
$size: an integer used in the 'size' attribute
-
string
$accept: a string saying which MIME types are allowed
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Produce a string containing a file upload input inside a table row
static string
returnFileRow
(string $name, string $title, [int $maxsize = HTML_FORM_MAX_FILE_SIZE], [int $size = HTML_FORM_TEXT_SIZE], [string $accept = ''], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
int
$maxsize: an integer determining how large (in bytes) a submitted file can be.
-
int
$size: an integer used in the 'size' attribute
-
string
$accept: a string saying which MIME types are allowed
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Produce a string containing a hiden input
static string
returnHidden
(string $name, string $value, [string $attr = ''])
-
string
$name: the string used in the 'name' attribute
-
string
$value: the string used for the item's value
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Produce a string containing an image input
static string
returnImage
(string $name, string $src, [string $attr = ''])
-
string
$name: the string used in the 'name' attribute
-
string
$src: the string denoting the path to the image. Can be a relative path or full URI.
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Produce a string containing an image input inside a table row
static string
returnImageRow
(string $name, string $title, string $src, [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
string
$src: the string denoting the path to the image. Can be a relative path or full URI.
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Produce a string containing a file upload input
static string
returnMultipleFiles
([string $name = 'userfile[]'], [int $maxsize = HTML_FORM_MAX_FILE_SIZE], [int $files = 3], [int $size = HTML_FORM_TEXT_SIZE], [string $accept = ''], [string $attr = ''])
-
string
$name: the string used in the 'name' attribute
-
int
$maxsize: an integer determining how large (in bytes) a submitted file can be.
-
int
$files: an integer of how many file inputs to show
-
int
$size: an integer used in the 'size' attribute
-
string
$accept: a string saying which MIME types are allowed
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Produce a string containing a password input
static string
returnPassword
(string $name, [mixed $default = null], [int $size = HTML_FORM_PASSWD_SIZE], [int $maxlength = 0], [string $attr = ''])
-
string
$name: the string used in the 'name' attribute
-
mixed
$default: a default value for the element
-
int
$size: an integer used in the 'size' attribute
-
int
$maxlength: an integer used in the 'maxlength' attribute
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Produce a string containing a password input inside a table row
static string
returnPasswordOneRow
(string $name, string $title, [mixed $default = null], [int $size = HTML_FORM_PASSWD_SIZE], [int $maxlength = 0], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
mixed
$default: a default value for the element
-
int
$size: an integer used in the 'size' attribute
-
int
$maxlength: an integer used in the 'maxlength' attribute
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Produce a string containing a combined password input and password confirmation input inside a table row
static string
returnPasswordRow
(string $name, string $title, [mixed $default = null], [int $size = HTML_FORM_PASSWD_SIZE], [int $maxlength = 0], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
mixed
$default: a default value for the element
-
int
$size: an integer used in the 'size' attribute
-
int
$maxlength: an integer used in the 'maxlength' attribute
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Produce a string containing the text provided
static string
returnPlaintext
([string $text = ' '])
-
string
$text: a string to be displayed
Produce a string containing the text provided inside a table row
static string
returnPlaintextRow
(string $title, [string $text = ' '], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$title: the string used as the label
-
string
$text: a string to be displayed
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Produce a string containing a radio input
static string
returnRadio
(string $name, string $value, [bool $default = false], [string $attr = ''])
-
string
$name: the string used in the 'name' attribute
-
string
$value: the string used for the item's value
-
bool
$default: a bool indicating if item should be checked
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Produce a string containing a radio input inside a table row
static string
returnRadioRow
(string $name, string $title, string $value, [bool $default = false], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
string
$value: the string used for the item's value
-
bool
$default: a bool indicating if item should be checked
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Produce a string containing a reset button
NOTE: Unusual parameter order.
static string
returnReset
([string $title = 'Clear contents'], [string $attr = ''])
-
string
$title: a string that appears on the button
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Produce a string containing a reset button inside a table row
NOTE: Unusual parameter order.
static string
returnResetRow
([string $title = 'Clear contents'], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$title: a string that appears on the button
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Produce a string containing a select list
NOTE: In order for defaults to be automatically selected in the output, the PHP data types of the $default must match the data types of the keys in the $entries array.
static string
returnSelect
(string $name, array $entries, [mixed $default = null], [int $size = 1], [string $blank = ''], [bool $multiple = false], [string $attr = ''])
-
string
$name: the string used in the 'name' attribute
-
array
$entries: an array containing the <options> to be listed. The array's keys become the option values and the array's values become the visible text.
-
mixed
$default: a default value for the element
-
int
$size: an integer saying how many rows should be
-
string
$blank: if this string is present, an <option> will be added to the top of the list that will contain the given text in the visible portion and an empty string as the value
-
bool
$multiple: a bool saying if multiple choices are allowed
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Produce a string containing a select list inside a table row
NOTE: In order for defaults to be automatically selected in the output, the PHP data types of the $default must match the data types of the keys in the $entries array.
static string
returnSelectRow
(string $name, string $title, array $entries, [mixed $default = null], [int $size = 1], [string $blank = ''], [bool $multiple = false], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
array
$entries: an array containing the <options> to be listed. The array's keys become the option values and the array's values become the visible text.
-
mixed
$default: a default value for the element
-
int
$size: an integer saying how many rows should be
-
string
$blank: if this string is present, an <option> will be added to the top of the list that will contain the given text in the visible portion and an empty string as the value
-
bool
$multiple: a bool saying if multiple choices are allowed
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Produce a string containing a submit button
NOTE: Unusual parameter order.
static string
returnSubmit
([string $title = 'Submit Changes'], [string $name = 'submit'], [string $attr = ''])
-
string
$title: a string that appears on the button
-
string
$name: a string used in the 'name' attribute
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Produce a string containing a submit button inside a table row
static string
returnSubmitRow
([string $name = 'submit'], [string $title = 'Submit Changes'], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: a string used in the 'name' attribute
-
string
$title: a string that appears on the button
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Produce a string containing a text input
static string
returnText
(string $name, [mixed $default = null], [int $size = HTML_FORM_TEXT_SIZE], [int $maxlength = 0], [string $attr = ''])
-
string
$name: the string used in the 'name' attribute
-
mixed
$default: a default value for the element
-
int
$size: an integer used in the 'size' attribute
-
int
$maxlength: an integer used in the 'maxlength' attribute
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Produce a string containing a textarea input
static string
returnTextarea
(string $name, [mixed $default = null], [int $width = 40], [int $height = 5], [int $maxlength = 0], [string $attr = ''])
-
string
$name: the string used in the 'name' attribute
-
mixed
$default: a default value for the element
-
int
$width: an integer saying how many characters wide the item should be
-
int
$height: an integer saying how many rows tall the item should be
-
int
$maxlength: an integer used in the 'maxlength' attribute
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Produce a string containing a textarea input inside a table row
static string
returnTextareaRow
(string $name, string $title, [mixed $default = null], [int $width = 40], [int $height = 5], [int $maxlength = 0], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
mixed
$default: a default value for the element
-
int
$width: an integer saying how many characters wide the item should be
-
int
$height: an integer saying how many rows tall the item should be
-
int
$maxlength: an integer used in the 'maxlength' attribute
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Produce a string containing a text input inside a table row
static string
returnTextRow
(string $name, string $title, [mixed $default = null], [int $size = HTML_FORM_TEXT_SIZE], [int $maxlength = 0], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
mixed
$default: a default value for the element
-
int
$size: an integer used in the 'size' attribute
-
int
$maxlength: an integer used in the 'maxlength' attribute
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Constructor
void
HTML_Form
(string $action, [string $method = 'get'], [string $name = ''], [string $target = ''], [string $enctype = ''], [string $attr = ''])
-
string
$action: the string naming file or URI to which the form should be submitted
-
string
$method: a string indicating the submission method ('get' or 'post')
-
string
$name: a string used in the <form>'s 'name' attribute
-
string
$target: a string used in the <form>'s 'target' attribute
-
string
$enctype: a string indicating the submission's encoding
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Adds a blank row to the list of fields to be processed by display()
void
addBlank
(int $i, [string $title = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
int
$i: the number of rows to create. Ignored if $title is used.
-
string
$title: a string to be used as the label for the row
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
void
addCaptcha
( $name, $title, [ $default = null], [ $size = HTML_FORM_TEXT_SIZE], [ $maxlength = 0], [ $attr = ''], [ $thattr = HTML_FORM_TH_ATTR], [ $tdattr = HTML_FORM_TD_ATTR])
-
$name
-
$title
-
$default
-
$size
-
$maxlength
-
$attr
-
$thattr
-
$tdattr
Adds a checkbox input to the list of fields to be processed by display()
void
addCheckbox
(string $name, string $title, [bool $default = false], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
bool
$default: a bool indicating if item should be checked
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
void
addDatepicker
( $name, $title, [ $default = null], [ $size = HTML_FORM_TEXT_SIZE], [ $maxlength = 0], [ $attr = ''], [ $thattr = HTML_FORM_TH_ATTR], [ $tdattr = HTML_FORM_TD_ATTR])
-
$name
-
$title
-
$default
-
$size
-
$maxlength
-
$attr
-
$thattr
-
$tdattr
Adds a file upload input to the list of fields to be processed by display()
void
addFile
(string $name, string $title, [int $maxsize = HTML_FORM_MAX_FILE_SIZE], [int $size = HTML_FORM_TEXT_SIZE], [string $accept = ''], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
int
$maxsize: an integer determining how large (in bytes) a submitted file can be.
-
int
$size: an integer used in the 'size' attribute
-
string
$accept: a string saying which MIME types are allowed
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Adds a hiden input to the list of fields to be processed by display()
void
addHidden
(string $name, string $value, [string $attr = ''])
-
string
$name: the string used in the 'name' attribute
-
string
$value: the string used for the item's value
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
Adds an image input to the list of fields to be processed by display()
void
addImage
(string $name, string $title, string $src, [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
string
$src: the string denoting the path to the image. Can be a relative path or full URI.
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Adds a combined password input and password confirmation input to the list of fields to be processed by display()
void
addPassword
(string $name, string $title, [mixed $default = null], [int $size = HTML_FORM_PASSWD_SIZE], [int $maxlength = 0], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
mixed
$default: a default value for the element
-
int
$size: an integer used in the 'size' attribute
-
int
$maxlength: an integer used in the 'maxlength' attribute
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Adds a password input to the list of fields to be processed by display()
void
addPasswordOne
(string $name, string $title, [mixed $default = null], [int $size = HTML_FORM_PASSWD_SIZE], [int $maxlength = 0], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
mixed
$default: a default value for the element
-
int
$size: an integer used in the 'size' attribute
-
int
$maxlength: an integer used in the 'maxlength' attribute
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Adds a row of text to the list of fields to be processed by display()
void
addPlaintext
(string $title, [string $text = ' '], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$title: the string used as the label
-
string
$text: a string to be displayed
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Adds a radio input to the list of fields to be processed by display()
void
addRadio
(string $name, string $title, string $value, [bool $default = false], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
string
$value: the string used for the item's value
-
bool
$default: a bool indicating if item should be checked
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Adds a reset button to the list of fields to be processed by display()
NOTE: Unusual parameter order.
void
addReset
([string $title = 'Discard Changes'], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$title: a string that appears on the button
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Adds a select list to the list of fields to be processed by display()
NOTE: In order for defaults to be automatically selected in the output, the PHP data types of the $default must match the data types of the keys in the $entries array.
void
addSelect
(string $name, string $title, array $entries, [mixed $default = null], [int $size = 1], [string $blank = ''], [bool $multiple = false], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
array
$entries: an array containing the <options> to be listed. The array's keys become the option values and the array's values become the visible text.
-
mixed
$default: a default value for the element
-
int
$size: an integer saying how many rows should be
-
string
$blank: if this string is present, an <option> will be added to the top of the list that will contain the given text in the visible portion and an empty string as the value
-
bool
$multiple: a bool saying if multiple choices are allowed
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Adds a submit button to the list of fields to be processed by display()
void
addSubmit
([string $name = 'submit'], [string $title = 'Submit Changes'], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: a string used in the 'name' attribute
-
string
$title: a string that appears on the button
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Adds a text input to the list of fields to be processed by display()
void
addText
(string $name, string $title, [mixed $default = null], [int $size = HTML_FORM_TEXT_SIZE], [int $maxlength = 0], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
mixed
$default: a default value for the element
-
int
$size: an integer used in the 'size' attribute
-
int
$maxlength: an integer used in the 'maxlength' attribute
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Adds a textarea input to the list of fields to be processed by display()
void
addTextarea
(string $name, string $title, [mixed $default = null], [int $width = HTML_FORM_TEXTAREA_WT], [int $height = HTML_FORM_TEXTAREA_HT], [int $maxlength = 0], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])
-
string
$name: the string used in the 'name' attribute
-
string
$title: the string used as the label
-
mixed
$default: a default value for the element
-
int
$width: an integer saying how many characters wide the item should be
-
int
$height: an integer saying how many rows tall the item should be
-
int
$maxlength: an integer used in the 'maxlength' attribute
-
string
$attr: a string of additional attributes to be put in the element (example: 'id="foo"')
-
string
$thattr: a string of additional attributes to be put in the <th> element (example: 'class="foo"')
-
string
$tdattr: a string of additional attributes to be put in the <td> element (example: 'class="foo"')
Prints a complete form with all fields you specified via the add*() methods
If you did not specify a field's default value (via the $default parameter to the add*() method in question), this method will automatically insert the user input found in $_GET/$_POST. This behavior can be disabled via setDefaultFromInput(false).
The $_GET/$_POST input is automatically escaped via htmlspecialchars(). This behavior can be disabled via setEscapeDefaultFromInput(false).
If the $_GET/$_POST superglobal doesn't exist, then $HTTP_GET_VARS/$HTTP_POST_VARS is used.
NOTE: can NOT be called statically.
void
display
([string $attr = ''], [string $caption = ''], [string $capattr = ''])
-
string
$attr: a string of additional attributes to be put in the <table> tag (example: 'class="foo"')
-
string
$caption: if present, a <caption> is added to the table
-
string
$capattr: a string of additional attributes to be put in the <caption> tag (example: 'class="foo"')
void
displayCaptcha
( $name, [ $default = null], [ $size = HTML_FORM_TEXT_SIZE], [ $maxlength = 0], [ $attr = ''])
-
$name
-
$default
-
$size
-
$maxlength
-
$attr
void
displayDatepicker
( $name, [ $default = null], [ $size = HTML_FORM_TEXT_SIZE], [ $maxlength = 0], [ $attr = ''])
-
$name
-
$default
-
$size
-
$maxlength
-
$attr
void
displayDatepickerRow
( $name, $title, [ $default = null], [ $size = HTML_FORM_TEXT_SIZE], [ $maxlength = 0], [ $attr = ''], [ $thattr = HTML_FORM_TH_ATTR], [ $tdattr = HTML_FORM_TD_ATTR])
-
$name
-
$title
-
$default
-
$size
-
$maxlength
-
$attr
-
$thattr
-
$tdattr
Prints the ending tags for the table and form
NOTE: can NOT be called statically.
void
end
()
void
returnCaptcha
( $name, [ $default = null], [ $size = HTML_FORM_TEXT_SIZE], [ $maxlength = 0], [ $attr = ''])
-
$name
-
$default
-
$size
-
$maxlength
-
$attr
void
returnCaptchaRow
( $name, $title, [ $default = null], [ $size = HTML_FORM_TEXT_SIZE], [ $maxlength = 0], [ $attr = ''], [ $thattr = HTML_FORM_TH_ATTR], [ $tdattr = HTML_FORM_TD_ATTR])
-
$name
-
$title
-
$default
-
$size
-
$maxlength
-
$attr
-
$thattr
-
$tdattr
void
returnDatepickerRow
( $name, $title, [ $default = null], [ $size = HTML_FORM_TEXT_SIZE], [ $maxlength = 0], [ $attr = ''], [ $thattr = HTML_FORM_TH_ATTR], [ $tdattr = HTML_FORM_TD_ATTR])
-
$name
-
$title
-
$default
-
$size
-
$maxlength
-
$attr
-
$thattr
-
$tdattr
Produces a string containing the opening tags for the form and table
NOTE: can NOT be called statically.
string
returnEnd
()
Produces a string containing the opening tags for the form and table
NOTE: can NOT be called statically.
string
returnStart
([bool $multipartformdata = false])
-
bool
$multipartformdata: a bool indicating if the form should be submitted in multipart format
Enables/Disables $_GET/$_POST user input data showing up in fields when a $default hasn't been set
The default is TRUE.
void
setDefaultFromInput
(boolean $bool)
-
boolean
$bool: TRUE to use $_GET/$_POST for the default, FALSE to default to an empty string
Enables/Disables escaping of the $_GET/$_POST data that shows up in fields when a $default hasn't been set
The default is TRUE.
Uses htmlspecialchars() for the escaping.
void
setEscapeDefaultFromInput
(boolean $bool)
-
boolean
$bool: TRUE to escape, FALSE to disable escaping
Prints the opening tags for the form and table
NOTE: can NOT be called statically.
void
start
([bool $multipartformdata = false])
-
bool
$multipartformdata: a bool indicating if the form should be submitted in multipart format