(Yaf >=1.0.0)
Yaf_Request_Abstract::getMethod — 检索请求方法
此函数没有参数。
请求方法,以字符串形式表示,例如 GET、POST、PUT、DELETE。
示例 #1 Yaf_Request_Abstract::getMethod() 示例
<?php
class OrderController extends Yaf_Controller_Abstract
{
public function saveAction()
{
$request = $this->getRequest();
// 假设请求是通过 POST /order/save 发送的
var_dump($request->getMethod());
}
}
?>以上示例的输出类似于:
string(4) "POST"