> 在控制器中繼承 Base 類,該類繼承了 Yaf\Controller_Abstract
> 可以通過 使用$this->getRequest()來獲取Yaf框架定義的當前請求對象
[TOC]
## 當前的請求類型
方法返回的請求類型始終是大寫
```
$this->method()
```
## 是否AJAX請求
```
$this->isAjax()
```
## 是否JSON請求
```
$this->isJson()
```
## 是否PATCH請求
```
$this->isPatch()
```
## 是否DELETE請求
```
$this->isDelete()
```
## 是否GET請求
```
$this->isGet()
```
## 是否HEAD請求
```
$this->isHead()
```
## 是否ClI請求
```
$this->isCli()
```
## 是否Options請求
```
$this->isOptions()
```
## 是否POST請求
```
$this->isPost()
```
## 是否PUT操作
```
$this->isPut()
```
## 檢測是否使用手機訪問
$this->isMobile()