summaryrefslogtreecommitdiff
path: root/src/helpers.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2017-07-18 21:38:53 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2017-07-19 11:44:16 +0200
commit3a1e4602492cec1c8f3d2aabab2c866022f43bf1 (patch)
treec367c1ce15f957a1e9a0879b875e8d635883280e /src/helpers.php
parent04217834fa4e6f94fec0836a80ea5526b8ebc9bc (diff)
Changed $_GET, $_POST and $_REQUEST to use the Request object
Diffstat (limited to 'src/helpers.php')
-rw-r--r--src/helpers.php17
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);
+}