HTML_Form
[ class tree: HTML_Form ] [ index: HTML_Form ] [ all elements ]

Class: HTML_Form

Source Location: /HTML_Form-1.3.0/HTML/Form.php

Class Overview


HTML form utility functions


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 1997-2005 The PHP Group

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 128]
HTML form utility functions

Release 1.3.0 introduces very important security fixes. Please make sure you have upgraded.



[ Top ]


Class Variables

$action =

[line 136]

ACTION attribute of <form> tag

Type:   string


[ Top ]

$attr =

[line 179]

additional attributes for <form> tag
  • Since: Property available since Release 1.1.0

Type:   string


[ Top ]

$enctype =

[line 171]

ENCTYPE attribute of <form> tag

Type:   string


[ Top ]

$fields =

[line 154]

an array of entries for this form

Type:   array


[ Top ]

$method =

[line 142]

METHOD attribute of <form> tag

Type:   string


[ Top ]

$name =

[line 148]

NAME attribute of <form> tag

Type:   string


[ Top ]

$storageObject =

[line 159]

DB_storage object, if tied to one

Type:   mixed


[ Top ]

$target =

[line 165]

TARGET attribute of <form> tag

Type:   string


[ Top ]



Method Detail

HTML_Form (Constructor)   [line 248]

void HTML_Form( string $action, [string $method = 'get'], [string $name = ''], [string $target = ''], [string $enctype = ''], [string $attr = ''])

Constructor
  • Access: public

Parameters:

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"')

[ Top ]

addBlank   [line 676]

void addBlank( int $i, [string $title = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])

Adds a blank row to the list of fields to be processed by display()

Parameters:

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"')

[ Top ]

addCheckbox   [line 425]

void addCheckbox( string $name, string $title, [bool $default = false], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])

Adds a checkbox input to the list of fields to be processed by display()

Parameters:

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"')

[ Top ]

addFile   [line 708]

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])

Adds a file upload input to the list of fields to be processed by display()

Parameters:

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"')

[ Top ]

addHidden   [line 651]

void addHidden( string $name, string $value, [string $attr = ''])

Adds a hiden input to the list of fields to be processed by display()

Parameters:

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"')

[ Top ]

addImage   [line 627]

void addImage( string $name, string $title, string $src, [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])

Adds an image input to the list of fields to be processed by display()

Parameters:

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"')

[ Top ]

addPassword   [line 359]

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])

Adds a combined password input and password confirmation input to the list of fields to be processed by display()

Parameters:

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"')

[ Top ]

addPasswordOne   [line 394]

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])

Adds a password input to the list of fields to be processed by display()

Parameters:

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"')

[ Top ]

addPlaintext   [line 737]

void addPlaintext( string $title, [string $text = ' '], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])

Adds a row of text to the list of fields to be processed by display()

Parameters:

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"')

[ Top ]

addRadio   [line 596]

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])

Adds a radio input to the list of fields to be processed by display()

Parameters:

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"')

[ Top ]

addReset   [line 521]

void addReset( [string $title = 'Discard Changes'], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])

Adds a reset button to the list of fields to be processed by display()

NOTE: Unusual parameter order.


Parameters:

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"')

[ Top ]

addSelect   [line 563]

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])

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.


Parameters:

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"')

[ Top ]

addSubmit   [line 491]

void addSubmit( [string $name = 'submit'], [string $title = 'Submit Changes'], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])

Adds a submit button to the list of fields to be processed by display()

Parameters:

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"')

[ Top ]

addText   [line 323]

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])

Adds a text input to the list of fields to be processed by display()

Parameters:

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"')

[ Top ]

addTextarea   [line 460]

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])

Adds a textarea input to the list of fields to be processed by display()

Parameters:

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"')

[ Top ]

display   [line 2585]

void display( [string $attr = ''], [string $caption = ''], [string $capattr = ''])

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.


Parameters:

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"')

[ Top ]

displayBlank   [line 1396]

void displayBlank( )

Prints &nbsp;

[ Top ]

displayBlankRow   [line 1421]

void displayBlankRow( int $i, [string $title = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])

Prints a blank row in the table

Parameters:

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"')

[ Top ]

displayCheckbox   [line 961]

void displayCheckbox( string $name, [bool $default = false], [string $attr = ''])

Prints a checkbox input

Parameters:

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"')

[ Top ]

displayCheckboxRow   [line 988]

void displayCheckboxRow( string $name, string $title, [bool $default = false], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])

Prints a checkbox input inside a table row

Parameters:

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"')

[ Top ]

displayFile   [line 1448]

void displayFile( string $name, [int $maxsize = HTML_FORM_MAX_FILE_SIZE], [int $size = HTML_FORM_TEXT_SIZE], [string $accept = ''], [string $attr = ''])

Prints a file upload input

Parameters:

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"')

[ Top ]

displayFileRow   [line 1481]

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])

Prints a file upload input inside a table row

Parameters:

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"')

[ Top ]

displayHidden   [line 1321]

void displayHidden( string $name, string $value, [string $attr = ''])

Prints a hiden input

Parameters:

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"')

[ Top ]

displayImage   [line 1268]

void displayImage( string $name, string $src, [string $attr = ''])

Prints an image input

Parameters:

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"')

[ Top ]

displayImageRow   [line 1297]

void displayImageRow( string $name, string $title, string $src, [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])

Prints an image input inside a table row

Parameters:

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"')

[ Top ]

displayPassword   [line 862]

void displayPassword( string $name, [mixed $default = null], [int $size = HTML_FORM_PASSWD_SIZE], [int $maxlength = 0], [string $attr = ''])

Prints a password input

Parameters:

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"')

[ Top ]

displayPasswordOneRow   [line 933]

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])

Prints a password input inside a table row

Parameters:

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"')

[ Top ]

displayPasswordRow   [line 896]

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])

Prints a combined password input and password confirmation input inside a table row

Parameters:

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"')

[ Top ]

displayPlaintext   [line 1505]

void displayPlaintext( [string $text = ' '])

Prints the text provided

Parameters:

string   $text     a string to be displayed

[ Top ]

displayPlaintextRow   [line 1529]

void displayPlaintextRow( string $title, [string $text = ' '], [string $thattr = 'align="right valign="top""'], [string $tdattr = HTML_FORM_TD_ATTR])

Prints the text provided inside a table row

Parameters:

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"')

[ Top ]

displayRadio   [line 1347]

void displayRadio( string $name, string $value, [bool $default = false], [string $attr = ''])

Prints a radio input

Parameters:

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"')

[ Top ]

displayRadioRow   [line 1375]

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])

Prints a radio input inside a table row

Parameters:

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"')

[ Top ]

displayReset   [line 1133]

void displayReset( [string $title = 'Clear contents'], [string $attr = ''])

Prints a reset button

NOTE: Unusual parameter order.


Parameters:

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"')

[ Top ]

displayResetRow   [line 1160]

void displayResetRow( [string $title = 'Clear contents'], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])

Prints a reset button inside a table row

NOTE: Unusual parameter order.


Parameters:

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"')

[ Top ]

displaySelect   [line 1197]

void displaySelect( string $name, array $entries, [mixed $default = null], [int $size = 1], [string $blank = ''], [bool $multiple = false], [string $attr = ''])

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.


Parameters:

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"')

[ Top ]

displaySelectRow   [line 1239]

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])

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.


Parameters:

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"')

[ Top ]

displaySubmit   [line 1081]

void displaySubmit( [string $title = 'Submit Changes'], [string $name = 'submit'], [string $attr = ''])

Prints a submit button

NOTE: Unusual parameter order.


Parameters:

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"')

[ Top ]

displaySubmitRow   [line 1108]

void displaySubmitRow( [string $name = 'submit'], [string $title = 'Submit Changes'], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])

Prints a submit button inside a table row

Parameters:

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"')

[ Top ]

displayText   [line 804]

void displayText( string $name, [mixed $default = null], [int $size = HTML_FORM_TEXT_SIZE], [int $maxlength = 0], [string $attr = ''])

Prints a text input element

Parameters:

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"')

[ Top ]

displayTextarea   [line 1018]

void displayTextarea( string $name, [mixed $default = null], [int $width = 40], [int $height = 5], [int $maxlength = ''], [string $attr = ''])

Prints a textarea input

Parameters:

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"')

[ Top ]

displayTextareaRow   [line 1052]

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])

Prints a textarea input inside a table row

Parameters:

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"')

[ Top ]

displayTextRow   [line 834]

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])

Prints a text input element inside a table row

Parameters:

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"')

[ Top ]

end   [line 780]

void end( )

Prints the ending tags for the table and form

NOTE: can NOT be called statically.


[ Top ]

returnBlank   [line 2268]

string returnBlank( )

Produce a string containing &nbsp;

[ Top ]

returnBlankRow   [line 2294]

string returnBlankRow( int $i, [string $title = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])

Produce a string containing a blank row in the table

Parameters:

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"')

[ Top ]

returnCheckbox   [line 1744]

string returnCheckbox( string $name, [bool $default = false], [string $attr = ''])

Produce a string containing a checkbox input

Parameters:

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"')

[ Top ]

returnCheckboxRow   [line 1775]

string returnCheckboxRow( string $name, string $title, [bool $default = false], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])

Produce a string containing a checkbox input inside a table row

Parameters:

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"')

[ Top ]

returnEnd   [line 2482]

string returnEnd( )

Produces a string containing the opening tags for the form and table

NOTE: can NOT be called statically.


[ Top ]

returnFile   [line 2335]

string returnFile( [string $name = 'userfile'], [int $maxsize = HTML_FORM_MAX_FILE_SIZE], [int $size = HTML_FORM_TEXT_SIZE], [string $accept = ''], [string $attr = ''])

Produce a string containing a file upload input

Parameters:

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"')

[ Top ]

returnFileRow   [line 2376]

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])

Produce a string containing a file upload input inside a table row

Parameters:

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"')

[ Top ]

returnHidden   [line 2248]

string returnHidden( string $name, string $value, [string $attr = ''])

Produce a string containing a hiden input

Parameters:

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"')

[ Top ]

returnImage   [line 2190]

string returnImage( string $name, string $src, [string $attr = ''])

Produce a string containing an image input

Parameters:

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"')

[ Top ]

returnImageRow   [line 2220]

string returnImageRow( string $name, string $title, string $src, [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])

Produce a string containing an image input inside a table row

Parameters:

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"')

[ Top ]

returnMultipleFiles   [line 2415]

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 = ''])

Produce a string containing a file upload input

Parameters:

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"')

[ Top ]

returnPassword   [line 1628]

string returnPassword( string $name, [mixed $default = null], [int $size = HTML_FORM_PASSWD_SIZE], [int $maxlength = 0], [string $attr = ''])

Produce a string containing a password input

Parameters:

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"')

[ Top ]

returnPasswordOneRow   [line 1710]

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])

Produce a string containing a password input inside a table row

Parameters:

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"')

[ Top ]

returnPasswordRow   [line 1665]

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])

Produce a string containing a combined password input and password confirmation input inside a table row

Parameters:

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"')

[ Top ]

returnPlaintext   [line 2515]

string returnPlaintext( [string $text = ' '])

Produce a string containing the text provided

Parameters:

string   $text     a string to be displayed

[ Top ]

returnPlaintextRow   [line 2539]

string returnPlaintextRow( string $title, [string $text = ' '], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])

Produce a string containing the text provided inside a table row

Parameters:

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"')

[ Top ]

returnRadio   [line 2127]

string returnRadio( string $name, string $value, [bool $default = false], [string $attr = ''])

Produce a string containing a radio input

Parameters:

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"')

[ Top ]

returnRadioRow   [line 2159]

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])

Produce a string containing a radio input inside a table row

Parameters:

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"')

[ Top ]

returnReset   [line 1948]

string returnReset( [string $title = 'Clear contents'], [string $attr = ''])

Produce a string containing a reset button

NOTE: Unusual parameter order.


Parameters:

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"')

[ Top ]

returnResetRow   [line 1976]

string returnResetRow( [string $title = 'Clear contents'], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])

Produce a string containing a reset button inside a table row

NOTE: Unusual parameter order.


Parameters:

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"')

[ Top ]

returnSelect   [line 2020]

string returnSelect( string $name, array $entries, [mixed $default = null], [int $size = 1], [string $blank = ''], [bool $multiple = false], [string $attr = ''])

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.


Parameters:

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"')

[ Top ]

returnSelectRow   [line 2092]

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])

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.


Parameters:

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"')

[ Top ]

returnStart   [line 2450]

string returnStart( [bool $multipartformdata = false])

Produces a string containing the opening tags for the form and table

NOTE: can NOT be called statically.


Parameters:

bool   $multipartformdata     a bool indicating if the form should be submitted in multipart format

[ Top ]

returnSubmit   [line 1888]

string returnSubmit( [string $title = 'Submit Changes'], [string $name = 'submit'], [string $attr = ''])

Produce a string containing a submit button

NOTE: Unusual parameter order.


Parameters:

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"')

[ Top ]

returnSubmitRow   [line 1916]

string returnSubmitRow( [string $name = 'submit'], [string $title = 'Submit Changes'], [string $attr = ''], [string $thattr = HTML_FORM_TH_ATTR], [string $tdattr = HTML_FORM_TD_ATTR])

Produce a string containing a submit button inside a table row

Parameters:

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"')

[ Top ]

returnText   [line 1558]

string returnText( string $name, [mixed $default = null], [int $size = HTML_FORM_TEXT_SIZE], [int $maxlength = 0], [string $attr = ''])

Produce a string containing a text input

Parameters:

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"')

[ Top ]

returnTextarea   [line 1811]

string returnTextarea( string $name, [mixed $default = null], [int $width = 40], [int $height = 5], [int $maxlength = 0], [string $attr = ''])

Produce a string containing a textarea input

Parameters:

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"')

[ Top ]

returnTextareaRow   [line 1853]

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])

Produce a string containing a textarea input inside a table row

Parameters:

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"')

[ Top ]

returnTextRow   [line 1593]

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])

Produce a string containing a text input inside a table row

Parameters:

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"')

[ Top ]

setDefaultFromInput   [line 274]

void setDefaultFromInput( boolean $bool)

Enables/Disables $_GET/$_POST user input data showing up in fields when a $default hasn't been set

The default is TRUE.


Parameters:

boolean   $bool     TRUE to use $_GET/$_POST for the default, FALSE to default to an empty string

[ Top ]

setEscapeDefaultFromInput   [line 293]

void setEscapeDefaultFromInput( boolean $bool)

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.


Parameters:

boolean   $bool     TRUE to escape, FALSE to disable escaping

[ Top ]

start   [line 762]

void start( [bool $multipartformdata = false])

Prints the opening tags for the form and table

NOTE: can NOT be called statically.


Parameters:

bool   $multipartformdata     a bool indicating if the form should be submitted in multipart format

[ Top ]


Documentation generated on Sun, 16 Oct 2005 15:30:11 -0400 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.