Class TFormDisplay

Description

Displays the value of a field. Only for display purposes, not used in queries.

  • version: 06-19-2002 11:50
  • author: Greg MacLellan

Located in /form-display.inc.php (line 12)

TFormElement
   |
   --TFormDisplay
Variable Summary
mixed $additional
mixed $callback
mixed $htmltype
mixed $passVars
mixed $type
Method Summary
TFormDisplay TFormDisplay (string $name, string $displayname, [string $callback = null], [array $additional = null], [bool $passVars = false])
The output ()
Variables
mixed $additional (line 16)

Any additional values to be passed to the callback

mixed $callback (line 14)

The name of the callback function to use

mixed $htmltype = "" (line 22)

The HTML element type


Redefinition of:
TFormElement::$htmltype
The HTML element type
mixed $passVars (line 18)

If we should pass variables instead of an array

mixed $type = "display" (line 20)

The type of element


Redefinition of:
TFormElement::$type
The type of element

Inherited Variables

Inherited from TFormElement

TFormElement::$alwaysSet
TFormElement::$class
TFormElement::$displayname
TFormElement::$name
TFormElement::$parent
TFormElement::$store
TFormElement::$value
Methods
Constructor TFormDisplay (line 49)

Creates a new TFormDisplay element (for displaying information or read-only fields)

TFormDisplay TFormDisplay (string $name, string $displayname, [string $callback = null], [array $additional = null], [bool $passVars = false])
  • string $name: The name of the database field to use
  • string $displayname: The name that should show up to the user for this field.
  • string $callback: The name of a callback function to use. Should accept one parameter, which will be an associative array containing: "name" ($name), "value" (of field), "table" (table for form), "keyfield" (keyfield for form), "keyidvar" (name of variable with id), and "keyid" (key value). Should return the exact text to display, including any html formatting.
  • array $additional: Any additional values that should be passed to the callback function.
  • bool $passVars: True if the paramters ($additional) should be passed as individual values. By default, one array is passed, and a number of other variables (name, value, table, keyfield, keyidvar, keyid) are introduced. When this is true, one of the paramaters should be "\$this->getValue()", which will be the value of the field (as a string, as it will be eval()'d). As an example, to display a field "Created" (INT, storing unix timestamp) via PHP's date() function, use: new TFormDisplay("Created", "Created", "date", array("M d Y","\$this->getValue()"), true)
output (line 62)

Output the value.

This will invoke the callback function, if it's being used.

  • return: value to display.
The output ()

Redefinition of:
TFormElement::output()
Outputs the HTML for this tag

Inherited Methods

Inherited From TFormElement

TFormElement::TFormElement()
TFormElement::getValue()
TFormElement::output()
TFormElement::setParent()
TFormElement::setValue()
TFormElement::validate()

Documentation generated on Thu, 27 Nov 2003 14:58:54 -0500 by phpDocumentor 1.2.3