summaryrefslogtreecommitdiffstats
path: root/system/core/Input.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/core/Input.php')
-rwxr-xr-xsystem/core/Input.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/system/core/Input.php b/system/core/Input.php
index ee15f4013..e8e3b1d9c 100755
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -699,6 +699,35 @@ class CI_Input {
return (php_sapi_name() === 'cli' OR defined('STDIN'));
}
+ // --------------------------------------------------------------------
+
+ /**
+ * Get Request Method
+ *
+ * Return the Request Method in lowercase
+ *
+ * @return mixed
+ */
+ public function method()
+ {
+ return strtolower($this->server('REQUEST_METHOD'));
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Validate parameter against $_SERVER['REQUEST_METHOD']
+ *
+ * Return TRUE if method equals $_SERVER['REQUEST_METHOD'], otherwise return FALSE
+ *
+ * @param string request method to match
+ * @return bool
+ */
+ public function is_method($method = '')
+ {
+ return ($this->method() === strtolower($method));
+ }
+
}
/* End of file Input.php */