Files
in package
implements
Iterator
Class Files An array-based collection of files.
Tags
Interfaces, Classes and Traits
- Iterator
Table of Contents
- $datas : array<string|int, mixed>
- $position : int
- __construct() : mixed
- Initialize the class.
- add() : mixed
- Add a file to the collection.
- current() : UploadedFile
- Get the current UploadedFile.
- get() : UploadedFile|null
- Get the specified file.
- key() : string
- Get the key or index of the current UploadedFile in the list.
- next() : mixed
- Move to the next UploadedFile in the list.
- rewind() : mixed
- Rewind the Iterator to the first element.
- valid() : bool
- Checks if the current position is valid.
Properties
$datas
private
array<string|int, mixed>
$datas
= []
$position
private
int
$position
= 0
Methods
__construct()
Initialize the class.
public
__construct() : mixed
Return values
mixed —add()
Add a file to the collection.
public
add(string $name, string $path, string $originalName[, string $mimeType = null ][, int $size = null ][, int $error = null ]) : mixed
Parameters
- $name : string
-
Input name
- $path : string
-
Uploaded file path
- $originalName : string
-
Uploaded file name
- $mimeType : string = null
-
MIME Type
- $size : int = null
-
Uploaded file size
- $error : int = null
-
Upload error UPLOAD_ERR_XXX
Return values
mixed —current()
Get the current UploadedFile.
public
current() : UploadedFile
Return values
UploadedFile —get()
Get the specified file.
public
get(string|int $key) : UploadedFile|null
Parameters
- $key : string|int
-
The requested item
Return values
UploadedFile|null —key()
Get the key or index of the current UploadedFile in the list.
public
key() : string
Return values
string —next()
Move to the next UploadedFile in the list.
public
next() : mixed
Return values
mixed —rewind()
Rewind the Iterator to the first element.
public
rewind() : mixed
Return values
mixed —valid()
Checks if the current position is valid.
public
valid() : bool