PHP 8.6.0 Beta 3 is available for testing

Yaf_Request_Abstract::isPut

(Yaf >=1.0.0)

Yaf_Request_Abstract::isPutDetermine if the request is a PUT request

Опис

public function Yaf_Request_Abstract::isPut(): bool

Checks whether the request was sent with the PUT method.

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

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

Приклади

Приклад #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());
    }
}
?>

Поданий вище приклад виведе щось схоже на:

bool(true)

Прогляньте також

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top