PHP 8.6.0 Beta 3 is available for testing

Yaf_Response_Abstract::clearHeaders

(Yaf >=1.0.0)

Yaf_Response_Abstract::clearHeadersRemove all response headers

Açıklama

public function Yaf_Response_Abstract::clearHeaders(): Yaf_Response_Abstract|false|null

Remove all HTTP response headers that have been set.

Bilginize:

This method is only fully implemented in the Yaf_Response_Http subclass. In the abstract class it is a stub.

Bağımsız Değişkenler

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

Dönen Değerler

Returns the response object itself on success, or false on failure.

Örnekler

Örnek 1 Yaf_Response_Abstract::clearHeaders() example

<?php
class IndexController extends Yaf_Controller_Abstract
{
    public function indexAction()
    {
        $response = $this->getResponse();

        $response->setHeader("Content-Type", "application/json");
        $response->clearHeaders();

        var_dump($response->getHeader()); // array(0) { }
    }
}
?>

Ayrıca Bakınız

add a note

User Contributed Notes

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