class FormUtil

Methods

static bool
isEmpty(mixed$data)

Returns whether the given data is empty.

static array
mergeParamsAndFiles(array$params,array$files)

Recursively replaces or appends elements of the first array with elements of second array. If the key is an integer, the values will be appended to the new array; otherwise, the value from the second array will replace the one from the first array.

Details

staticbool isEmpty(mixed$data)

Returns whether the given data is empty.

This logic is reused multiple times throughout the processing of a form and needs to be consistent. PHP keyword empty cannot be used as it also considers 0 and "0" to be empty.

Parameters

mixed $data

Return Value

bool

staticarray mergeParamsAndFiles(array$params,array$files)

Recursively replaces or appends elements of the first array with elements of second array. If the key is an integer, the values will be appended to the new array; otherwise, the value from the second array will replace the one from the first array.

Parameters

array $params
array $files

Return Value

array