Yaf_Response_Abstract::prependBody
PHP function
Edit on GitHub ✎
(Yaf >=1.0.0)
Prepend to the response body
Description
Yaf_Response_Abstract::prependBody(string $body, [string $key]): Yaf_Response_Abstract|false|null
Prepend to the response body
Parameters
bodyThe content string.
keythe content key. If not specified,
Yaf_Response_Abstract::DEFAULT_BODYwill be used.
Return Values
Returns the response object itself on success, or false on failure.
Examples
Yaf_Response_Abstract::prependBody() example
php
<?php
$response = new Yaf_Response_Http();
$response->setBody("World")->prependBody("Hello ");
echo $response;
?>The above example will output something similar to:
output
Hello WorldSee Also
Yaf_Response_Abstract::getBodyYaf_Response_Abstract::setBodyYaf_Response_Abstract::appendBodyYaf_Response_Abstract::clearBody