PHP 8.6.0 Beta 3 is available for testing

Yaf_Request_Abstract::isHead

(Yaf >=1.0.0)

Yaf_Request_Abstract::isHeadDetermine if the request is a HEAD request

Beschreibung

public function Yaf_Request_Abstract::isHead(): bool

Checks whether the request was sent with the HEAD method.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

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

Beispiele

Beispiel #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;
        }
    }
}
?>

Siehe auch

add a note

User Contributed Notes

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