Aplus Framework Docs

FilesValidator

Trait FilesValidator.

Table of Contents

dim()  : static
Validates image dimensions.
ext()  : static
Validates file accepted extensions.
image()  : static
Validates file is an image.
maxDim()  : static
Validates image max dimensions.
maxSize()  : static
Validates file size.
mimes()  : static
Validates file accepted MIME types.
minDim()  : static
Validates image min dimensions.
uploaded()  : static
Validates file is uploaded.

Methods

dim()

Validates image dimensions.

public dim(int $width, int $height) : static
Parameters
$width : int
$height : int
Return values
static

ext()

Validates file accepted extensions.

public ext(string ...$allowedExtensions) : static

NOTE: For greater security use the FilesValidator::mimes() method to filter the file type.

Parameters
$allowedExtensions : string
Return values
static

image()

Validates file is an image.

public image() : static
Return values
static

maxDim()

Validates image max dimensions.

public maxDim(int $width, int $height) : static
Parameters
$width : int
$height : int
Return values
static

maxSize()

Validates file size.

public maxSize(int $kilobytes) : static
Parameters
$kilobytes : int
Return values
static

mimes()

Validates file accepted MIME types.

public mimes(string ...$allowedTypes) : static
Parameters
$allowedTypes : string
Return values
static

minDim()

Validates image min dimensions.

public minDim(int $width, int $height) : static
Parameters
$width : int
$height : int
Return values
static

uploaded()

Validates file is uploaded.

public uploaded() : static
Return values
static

Search results