PHP 8.6.0 Beta 3 is available for testing

Yaf_Response_Abstract::prependBody

(Yaf >=1.0.0)

Yaf_Response_Abstract::prependBodyPrepend to the response body

Beschreibung

public function Yaf_Response_Abstract::prependBody(string $body, string $key = ?): Yaf_Response_Abstract|false|null

Prepend to the response body

Parameter-Liste

body

The content string.

key

the content key. If not specified, Yaf_Response_Abstract::DEFAULT_BODY will be used.

Rückgabewerte

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

Beispiele

Beispiel #1 Yaf_Response_Abstract::prependBody() example

<?php
$response = new Yaf_Response_Http();

$response->setBody("World")->prependBody("Hello ");

echo $response;
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

Hello World

Siehe auch

add a note

User Contributed Notes

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