diff options
Diffstat (limited to 'src/helpers.php')
-rw-r--r-- | src/helpers.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/helpers.php b/src/helpers.php index aeb256e9..a410b27e 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -2,6 +2,7 @@ // Some useful functions use Engelsystem\Config\Config; +use Engelsystem\Http\Request; /** * Get or set config values @@ -22,3 +23,19 @@ function config($key = null, $default = null) return Config::getInstance()->get($key, $default); } + +/** + * @param string $key + * @param mixed $default + * @return Request|mixed + */ +function request($key = null, $default = null) +{ + $request = Request::getInstance(); + + if (is_null($key)) { + return $request; + } + + return $request->input($key, $default); +} |