PHP Conference Ehime 2026

Yaf_Response_Abstract::setAllHeaders

(Yaf >=1.0.0)

Yaf_Response_Abstract::setAllHeadersSet all HTTP response headers

Açıklama

public function Yaf_Response_Abstract::setAllHeaders(array $headers): bool

Set all HTTP response headers at once.

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

headers

An array of header name/value pairs. Any existing header with the same name is replaced.

Dönen Değerler

Returns true.

Örnekler

Örnek 1 Yaf_Response_Abstract::setAllHeaders() example

<?php
class IndexController extends Yaf_Controller_Abstract
{
    public function indexAction()
    {
        $this->getResponse()->setAllHeaders(array(
            "Content-Type"  => "application/json; charset=utf-8",
            "Cache-Control" => "no-cache",
            "X-Request-Id"  => "7f3c2d91",
        ));
    }
}
?>

Ayrıca Bakınız

add a note

User Contributed Notes

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