Creates a new TFormFile element (basic file-upload)
TFormFileDisk
TFormFileDisk
(string $name, string $displayname, string $class, bool $required, string $storelocation, int $maxsize, [string $extraFields = array()], [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
-
bool
$required: True if the field has to be filled in
-
string
$storelocation: The full path in which to store the file. Must be writable by PHP
-
int
$maxsize: Maximum number of bytes. If 0, then the max is the maximum allowed by the webserver.
-
string
$extraFields: An array containing extra fieldnames, if used. Keys can be "size", "type", and "name", for size (bytes), mime type, and user's filename, respectively.
-
bool
$store: Whether this value is persistent. Used by TDBForm to decide to save/load this value from database.
Returns a textual description of the current value
An
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 value of the field to be the file data.
True
setValue
(array $value, [mixed $user = false])
-
array
$value: The value to set. Because this is a file type, this is an array containing "name","type","size","tmp_name", as documented in the php manual.
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()