Yaf_Request_Abstract::isHead
PHP Manual
PHP Manual»Yaf_Request_Abstract»Yaf_Request_Abstract::isHead

Yaf_Request_Abstract::isHead

(Yaf >=1.0.0)

Yaf_Request_Abstract::isHead — Determine if the request is a HEAD request

Açıklama

public function Yaf_Request_Abstract::isHead(): bool

Checks whether the request was sent with the HEAD 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 HEAD, false otherwise.

Örnekler

Örnek 1 Yaf_Request_Abstract::isHead() example

<?php
class FeedController extends Yaf_Controller_Abstract
{
    public function indexAction()
    {
        // Assuming the request was sent with HEAD /feed
        if ($this->getRequest()->isHead()) {
            // Headers only, skip rendering the body
            return false;
        }
    }
}
?>

Ayrıca Bakınız

To Top