diff --git a/framework/yii/web/Request.php b/framework/yii/web/Request.php index c6e1ce3b8d..2b9da0a1f8 100644 --- a/framework/yii/web/Request.php +++ b/framework/yii/web/Request.php @@ -136,6 +136,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. * @return boolean whether this is a POST request.