(Yaf >=1.0.0)
Yaf_Response_Abstract::setBody — 锟斤拷锟斤拷锟斤拷应锟斤拷Body
$content
[, string $key
] ) : bool锟斤拷锟斤拷锟斤拷应锟斤拷Body
body
content string
key
body锟斤拷锟斤拷应锟斤拷key锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟揭伙拷锟絙ody锟侥硷拷值锟皆o拷锟斤拷锟斤拷锟矫伙拷锟街革拷锟絢ey锟斤拷系统默锟斤拷使锟斤拷Yaf_Response_Abstract::DEFAULT_BODY
Note:
this parameter is introduced as of 2.2.0
Example #1 Yaf_Response_Abstract::setBody()example
<?php
$response = new Yaf_Response_Http();
$response->setBody("Hello")->setBody(" World", "footer");
print_r($response);
echo $response;
?>
锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�
Yaf_Response_Http Object ( [_header:protected] => Array ( ) [_body:protected] => Array ( [content] => Hello [footer] => World ) [_sendheader:protected] => 1 [_response_code:protected] => 200 ) Hello World