« Yaf_Request_Abstract::isOptions
Yaf_Request_Abstract::isPost »

Yaf_Request_Abstract::isPatch

(Yaf >=3.0.5)

Yaf_Request_Abstract::isPatch — Determine if the request is a PATCH request

説明

public function Yaf_Request_Abstract::isPatch(): bool

Checks whether the request was sent with the PATCH method.

パラメータ

この関数にはパラメータはありません。

戻り値

Returns true if the request method is PATCH, false otherwise.

例

例1 Yaf_Request_Abstract::isPatch() example

<?php
class ProfileController extends Yaf_Controller_Abstract
{
    public function updateAction()
    {
        // Assuming the request was sent with PATCH /profile/update
        var_dump($this->getRequest()->isPatch());
    }
}
?>

上の例の出力は、 たとえば以下のようになります。

bool(true)

参考

関連キーワード:
Abstract   Request   request   リクエスト   判定   isPatch   Determine   isOptions   isPost   sent   method   Checks   whether   otherwise   example   ProfileController   extends   Controller   updateAction   Assuming   profile   update   dump   getRequest   参考
関連する関数・ページ:
yaf-request-abstract.isdelete   yaf-request-abstract.ispost   yaf-request-abstract.isoptions   yaf-request-abstract.isput   yaf-request-abstract.ishead   yaf-request-abstract.iscli