Skip to content

Commit

Permalink
add checks for GET and OPTIONS requests
Browse files Browse the repository at this point in the history
  • Loading branch information
bwoester committed Sep 10, 2013
1 parent 590121c commit d02e7d4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions framework/yii/web/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,24 @@ public function getMethod()
}
}

/**
* Returns whether this is a GET request.
* @return boolean whether this is a GET request.
*/
public function getIsGet()
{
return $this->getMethod() === 'GET';
}

/**
* Returns whether this is an OPTIONS request.
* @return boolean whether this is a OPTIONS request.
*/
public function getIsOptions()
{
return $this->getMethod() === 'OPTIONS';
}

/**
* Returns whether this is a POST request.
* @return boolean whether this is a POST request.
Expand Down

0 comments on commit d02e7d4

Please sign in to comment.