Creates a new TFormCheckbox element (basic text field).
TFormCheckbox
TFormCheckbox
(string $name, string $displayname, string $class, [array $values = array(0=>"No",1=>"Yes")], [bool $checked = false], [bool $state = FORMCHECKBOX_STATE_ANY], [bool $store = true])
-
string
$name: The name of the element. This should correspond to the field names if using with TDBForm, and should not include any spaces or special characters.
-
string
$displayname: The name that should show up to the user for this field.
-
string
$class: The HTML Class to use for the element
-
array
$values: The storable and display values in an associative array. The first element is for unchecked, the second for checked
-
bool
$checked: The initial checked value of the field. Note this will be overridden when using TDBForm::loadData()
-
bool
$state: FORMCHECKBOX_STATE_ANY for normal operation, or FORMCHECKBOX_STATE_CHECKED if it has to be checked to be valid, or FORMCHECKBOX_STATE_UNCHECKED if it has to be unchecked.
-
bool
$store: True if this value is persistent. Used by TDBForm to decide to save/load this value from database.
Returns a textual description of the current value
A
getValue
([$display $display = false])
-
$display
$display: True if the value is going to be used for display
Redefinition of:
- TFormElement::getValue()
- Returns a textual description of the current value
Sets the checked state of the field. If there is any "value" then it sets checked to true.
true
setValue
(mixed $value, [bool $user = false])
-
mixed
$value: The value to set
-
bool
$user: True if the value is from user input
Redefinition of:
- TFormElement::setValue()
- Sets the value of the field
Inherited Methods
Inherited From TFormElement
TFormElement::TFormElement()
TFormElement::getValue()
TFormElement::output()
TFormElement::setParent()
TFormElement::setValue()
TFormElement::validate()