CakeRequest::_processFileData PHP Method

_processFileData() protected method

Recursively walks the FILES array restructuring the data into something sane and useable.
protected _processFileData ( string $path, array $data, string $field ) : void
$path string The dot separated path to insert $data into.
$data array The data to traverse/insert.
$field string The terminal field name, which is the top level key in $_FILES.
return void
    protected function _processFileData($path, $data, $field)
    {
        foreach ($data as $key => $fields) {
            $newPath = $key;
            if (strlen($path) > 0) {
                $newPath = $path . '.' . $key;
            }
            if (is_array($fields)) {
                $this->_processFileData($newPath, $fields, $field);
            } else {
                $newPath .= '.' . $field;
                $this->data = Hash::insert($this->data, $newPath, $fields);
            }
        }
    }