Asf_Http_Response::appendContent

追加 response 返回内容


Description

public bool appendContent(mixed $content)

Parameters

content

追加内容体, 支持所有PHP合法变量类型

Return Values

设置成功返回 true

Examples

Example #1

<?php
use Asf\Http\Response;

$rep = new Response();

$rep->setContent("Hello");
$rep->send(); echo PHP_EOL;

$rep->appendContent(" World");
$rep->send(); echo PHP_EOL;

$rep->appendContent(" , Come on");
$rep->send();

/* 输出值 */

{"errno":0,"data":"Hello"}
{"errno":0,"data":"Hello World"}
{"errno":0,"data":"Hello World , Come on"}