Yaf_Request_Abstract::isPut
PHP function
Edit on GitHub ✎
(Yaf >=1.0.0)
Determine if the request is a PUT request
Description
Yaf_Request_Abstract::isPut(): bool
Checks whether the request was sent with the PUT method.
Parameters Parameters
Return Values
Returns true if the request method is PUT, false otherwise.
Examples
Yaf_Request_Abstract::isPut example
php
<?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());
}
}
?>The above example will output something similar to:
output
bool(true)See Also
Yaf_Request_Abstract::isGetYaf_Request_Abstract::isPostYaf_Request_Abstract::isHeadYaf_Request_Abstract::isOptionsYaf_Request_Abstract::isDeleteYaf_Request_Abstract::isPatchYaf_Request_Abstract::isCliYaf_Request_Abstract::isXmlHttpRequest