Function __global->form_input_upload
Definitions
sources/form_templates.php
- Get the Tempcode for a file upload input.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: object
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $pretty_name | mixed | No | No | required parameter | N/A | N/A | A human intelligible name for this input field, provided in plain-text format (string or Tempcode) |
| $description | mixed | No | No | required parameter | N/A | N/A | A description for this input field, provided in HTML format (string or Tempcode) |
| $name | ID_TEXT | No | No | required parameter | N/A | N/A | The name which this input field is for |
| $required | boolean | No | No | required parameter | N/A | N/A | Whether this is a required input field. Set this to false if you are using this field on an edit form and already have an uploaded file -- therefore you'd know no new file would mean not to replace the existing file |
| $default | ?string | No | No | Null | N/A | N/A | The default value for the field (null: none) (blank: none). Should only be passed if $required is false, because it creates a delete button for the existing file, implying that leaving it with no file is valid |
| $tabindex | ?integer | No | No | Null | N/A | N/A | The tab index of the field (null: not specified) |
| $plupload | boolean | No | No | True | N/A | N/A | Whether plupload-style is preferred |
| $filter | string | No | No | Blank (empty string) | N/A | N/A | File-type filter to limit to, comma-separated file extensions (might not be supported) |
| $syndication_json | ?string | No | No | Null | N/A | N/A | JSON structure of what uploader syndications there will be (null: none) |
Returns
- The input field
- Type: Tempcode
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Get the Tempcode for a file upload input.
*
* @param mixed $pretty_name A human intelligible name for this input field, provided in plain-text format (string or Tempcode)
* @param mixed $description A description for this input field, provided in HTML format (string or Tempcode)
* @param ID_TEXT $name The name which this input field is for
* @param boolean $required Whether this is a required input field. Set this to false if you are using this field on an edit form and already have an uploaded file -- therefore you'd know no new file would mean not to replace the existing file
* @param ?string $default The default value for the field (null: none) (blank: none). Should only be passed if $required is false, because it creates a delete button for the existing file, implying that leaving it with no file is valid
* @param ?integer $tabindex The tab index of the field (null: not specified)
* @param boolean $plupload Whether plupload-style is preferred
* @param string $filter File-type filter to limit to, comma-separated file extensions (might not be supported)
* @param ?string $syndication_json JSON structure of what uploader syndications there will be (null: none)
* @return Tempcode The input field
*/
function form_input_upload($pretty_name, $description, string $name, bool $required, ?string $default = null, ?int $tabindex = null, bool $plupload = true, string $filter = '', ?string $syndication_json = null) : object
* Get the Tempcode for a file upload input.
*
* @param mixed $pretty_name A human intelligible name for this input field, provided in plain-text format (string or Tempcode)
* @param mixed $description A description for this input field, provided in HTML format (string or Tempcode)
* @param ID_TEXT $name The name which this input field is for
* @param boolean $required Whether this is a required input field. Set this to false if you are using this field on an edit form and already have an uploaded file -- therefore you'd know no new file would mean not to replace the existing file
* @param ?string $default The default value for the field (null: none) (blank: none). Should only be passed if $required is false, because it creates a delete button for the existing file, implying that leaving it with no file is valid
* @param ?integer $tabindex The tab index of the field (null: not specified)
* @param boolean $plupload Whether plupload-style is preferred
* @param string $filter File-type filter to limit to, comma-separated file extensions (might not be supported)
* @param ?string $syndication_json JSON structure of what uploader syndications there will be (null: none)
* @return Tempcode The input field
*/
function form_input_upload($pretty_name, $description, string $name, bool $required, ?string $default = null, ?int $tabindex = null, bool $plupload = true, string $filter = '', ?string $syndication_json = null) : object

