PHP Conference Ehime 2026

Yaf_Response_Abstract::__toString

(Yaf >=1.0.0)

Yaf_Response_Abstract::__toStringRetrieve all bodys as string

Açıklama

private function Yaf_Response_Abstract::__toString(): string

Returns all body blocks of the response, concatenated into a single string in the order in which they were added. This is what is output when a response object is used in a string context.

Bağımsız Değişkenler

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

Dönen Değerler

The response body as a string.

Örnekler

Örnek 1 Yaf_Response_Abstract::__toString() example

<?php
$response = new Yaf_Response_Http();

$response->setBody("Hello")->setBody(" World", "footer");

/* using the response in a string context renders all body blocks */
echo $response;
var_dump((string) $response);
?>

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

Hello World
string(11) "Hello World"

Ayrıca Bakınız

add a note

User Contributed Notes

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