Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added is_get_request and is_post_request() methods

  • Loading branch information...
commit ac046a6d95fc0e355b053597281c1e3e3a228398 1 parent cde712c
Matt Potts authored December 14, 2011

Showing 1 changed file with 30 additions and 0 deletions. Show diff stats Hide diff stats

  1. 30  system/core/Input.php
30  system/core/Input.php
@@ -727,6 +727,36 @@ public function is_ajax_request()
727 727
 	// --------------------------------------------------------------------
728 728
 
729 729
 	/**
  730
+	 * Is POST Request?
  731
+	 *
  732
+	 * Test to see if a HTTP method is POST
  733
+	 *
  734
+	 * @access	public
  735
+	 * @return 	boolean
  736
+	 */
  737
+	public function is_post_request()
  738
+	{
  739
+		return ('post' === strtolower($this->server('REQUEST_METHOD')));
  740
+	}
  741
+
  742
+	// --------------------------------------------------------------------
  743
+
  744
+	/**
  745
+	 * Is GET Request?
  746
+	 *
  747
+	 * Test to see if a HTTP method is GET
  748
+	 *
  749
+	 * @access	public
  750
+	 * @return 	boolean
  751
+	 */
  752
+	public function is_get_request()
  753
+	{
  754
+		return ('get' === strtolower($this->server('REQUEST_METHOD')));
  755
+	}
  756
+
  757
+	// --------------------------------------------------------------------
  758
+
  759
+	/**
730 760
 	 * Is cli Request?
731 761
 	 *
732 762
 	 * Test to see if a request was made from the command line

0 notes on commit ac046a6

Please sign in to comment.
Something went wrong with that request. Please try again.