Commit d02e7d40 by Benjamin Wöster

add checks for GET and OPTIONS requests

parent 590121c4
...@@ -137,6 +137,24 @@ class Request extends \yii\base\Request ...@@ -137,6 +137,24 @@ class Request extends \yii\base\Request
} }
/** /**
* 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. * Returns whether this is a POST request.
* @return boolean whether this is a POST request. * @return boolean whether this is a POST request.
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment