diff --git a/src/IParameters.php b/src/IParameters.php index f8b5908..72dae88 100644 --- a/src/IParameters.php +++ b/src/IParameters.php @@ -15,6 +15,8 @@ interface IParameters { public function post($key = NULL, $isRequired = FALSE, array $validators = null); + public function file($key = NULL, $isRequired = FALSE, array $validators = null); + public function get($key = NULL, $isRequired = FALSE, array $validators = null); public function path($key, $isRequired = FALSE, array $validators = null); diff --git a/src/Parameters.php b/src/Parameters.php index 33cafa8..46fad30 100644 --- a/src/Parameters.php +++ b/src/Parameters.php @@ -51,6 +51,15 @@ public function post($key = NULL, $isRequired = FALSE, array $validators = array return $return; } + public function file($key = null, $isRequired = FALSE, array $validators = array()){ + if($key) + $return = $this->request->getFile($key); + else + $return = $this->request->getFiles(); + $return = $this->validator->validate($key, $isRequired, $validators, $return); + return $return; + } + public function get($key = NULL, $isRequired = FALSE, array $validators = array()){ $return = $this->request->getQuery($key); $return = $this->validator->validate($key, $isRequired, $validators, $return);