Yaf_Request_Abstract::isPut
PHP Manual
PHP Manual»Yaf_Request_Abstract»Yaf_Request_Abstract::isPut

Yaf_Request_Abstract::isPut

(Yaf >=1.0.0)

Yaf_Request_Abstract::isPut — Determine if the request is a PUT request

Açıklama

public function Yaf_Request_Abstract::isPut(): bool

Checks whether the request was sent with the PUT method.

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

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

Örnekler

Örnek 1 Yaf_Request_Abstract::isPut() example

<?php
class DocumentController extends Yaf_Controller_Abstract
{
    public function saveAction()
    {
        // Assuming the request was sent with PUT /document/save/id/17
        if ($this->getRequest()->isPut()) {
            $payload = $this->getRequest()->getRaw();
        }

        var_dump($this->getRequest()->isPut());
    }
}
?>

Yukarıdaki örnek şuna benzer bir çıktı üretir:

bool(true)

Ayrıca Bakınız

To Top