PHP 8.6.0 Beta 3 is available for testing

Yaf_Response_Abstract::__construct

(Yaf >=1.0.0)

Yaf_Response_Abstract::__constructConstruct a response

Açıklama

public function Yaf_Response_Abstract::__construct()

Construct a response object. The constructor takes no arguments; the concrete subclasses like Yaf_Response_Http and Yaf_Response_Cli initialize their own defaults (an HTTP response starts with the 200 response code, for example).

Bilginize:

Usually a response object does not need to be constructed manually: Yaf_Dispatcher::getResponse() returns the one created by the dispatcher.

Bağımsız Değişkenler

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

Dönen Değerler

No value is returned.

Örnekler

Örnek 1 Yaf_Response_Abstract::__construct() example

<?php
/* usually there is no need to construct a response manually:
 * the dispatcher creates one and hands it out */
$response = Yaf_Dispatcher::getInstance()->getResponse();

/* constructing directly is mostly useful in tests */
$response = new Yaf_Response_Http();
$response->setBody("Hello World");

echo $response;
?>

Yukarıdaki örnek şuna benzer bir çıktı üretir:

Hello World

Ayrıca Bakınız

add a note

User Contributed Notes

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