FileUploadHelper
extends Helper
in package
This helper is used to render a drag and drop file upload region
Tags
Table of Contents
- $is_file_upload_initialized : bool
- Whether or not the Javascript for file uploads has already been output or not
- __construct() : mixed
- Sets up that the common translation scripts for upload regions on the page have not been rendered yet.
- render() : mixed
- Renders the UI needed to do a drag and file upload
- setupFileUploadParams() : mixed
- Writes the common Javascript strings associated with file upload
Properties
$is_file_upload_initialized
Whether or not the Javascript for file uploads has already been output or not
public
bool
$is_file_upload_initialized
Methods
__construct()
Sets up that the common translation scripts for upload regions on the page have not been rendered yet.
public
__construct() : mixed
Return values
mixed —render()
Renders the UI needed to do a drag and file upload
public
render(string $drop_id, string $form_name, string $elt_id, int $max_size, string $drop_kind, array<string|int, mixed> $allowed_types[, bool $multiple = false ]) : mixed
Parameters
- $drop_id : string
-
the id of the HTMLElement used as a target for dropping items in
- $form_name : string
-
the name attribute of the web form input element used to handle file uploads
- $elt_id : string
-
the id attribute of the web form input element used to handle file uploads
- $max_size : int
-
the maximum size in bytes of the objects allowed to uploaded
- $drop_kind : string
-
text or image this controls the way the drop zone is handled. Image will draw the to-upload image immediately
- $allowed_types : array<string|int, mixed>
-
what mime types are legal to upload
- $multiple : bool = false
-
whether multiple files can be selected when file picker used
Return values
mixed —setupFileUploadParams()
Writes the common Javascript strings associated with file upload
public
setupFileUploadParams() : mixed