WeAreAthlon / Silla.IO

PHP Application Development Framework.
https://silla.io
GNU General Public License v3.0
25 stars 3 forks source link

Router\Request to expose $_FILES #50

Closed pnikolov closed 9 years ago

pnikolov commented 9 years ago

Current Core\Modules\Router\Request object does not expose $_FILES values. A possible implementation, compatible with the other similar methods:

/**
 * Retrieves the FILES request params - $context[_FILES] contents.
 *
 * @param string $key Name of the parameter(optional).
 *
 * @access public
 *
 * @return mixed $_FILES array contents.
 */
public function files($key = null)
{
    if ($key) {
      return isset($this->context['_FILES'][$key]) ? $this->context['_FILES'][$key] : null;
    }

    return $this->context['_FILES'];
}