summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source
diff options
context:
space:
mode:
Diffstat (limited to 'user_guide_src/source')
-rw-r--r--user_guide_src/source/changelog.rst2
-rw-r--r--user_guide_src/source/libraries/input.rst31
2 files changed, 30 insertions, 3 deletions
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index b5fb52df4..f8c4ba144 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -97,6 +97,8 @@ Release Date: Not Released
- Added method get_vars() to CI_Loader to retrieve all variables loaded with $this->load->vars().
- is_loaded() function from system/core/Commons.php now returns a reference.
- $config['rewrite_short_tags'] now has no effect when using PHP 5.4 as *<?=* will always be available.
+ - Added method() to CI_Input to retrieve $_SERVER['REQUEST_METHOD'] in lowercase.
+ - Added is_method() to CI_Input to validate custom request method against $_SERVER['REQUEST_METHOD'].
Bug fixes for 3.0
------------------
diff --git a/user_guide_src/source/libraries/input.rst b/user_guide_src/source/libraries/input.rst
index bcf117358..96d1f07e1 100644
--- a/user_guide_src/source/libraries/input.rst
+++ b/user_guide_src/source/libraries/input.rst
@@ -99,7 +99,7 @@ The function returns FALSE (boolean) if there are no items in the POST.
::
- $this->input->post(NULL, TRUE); // returns all POST items with XSS filter
+ $this->input->post(NULL, TRUE); // returns all POST items with XSS filter
$this->input->post(); // returns all POST items without XSS filter
$this->input->get()
@@ -119,9 +119,9 @@ The function returns FALSE (boolean) if there are no items in the GET.
::
- $this->input->get(NULL, TRUE); // returns all GET items with XSS filter
+ $this->input->get(NULL, TRUE); // returns all GET items with XSS filter
$this->input->get(); // returns all GET items without XSS filtering
-
+
$this->input->get_post()
=========================
@@ -298,3 +298,28 @@ see if PHP is being run on the command line.
$this->input->is_cli_request()
+$this->input->method();
+=====================================
+
+Returns the $_SERVER['REQUEST_METHOD'] in lowercase.
+
+::
+
+ $this->input->method();
+
+$this->input->is_method($method);
+=====================================
+
+Returns TRUE if given method equals $_SERVER['REQUEST_METHOD'], otherwise returns FALSE.
+
+::
+
+ if ( ! $this->input->is_method('post'))
+ {
+ echo 'This is NOT a POST request';
+ }
+ else
+ {
+ echo 'This is a POST request';
+ }
+