本文整理汇总了PHP中HttpResponse::status方法的典型用法代码示例。如果您正苦于以下问题:PHP HttpResponse::status方法的具体用法?PHP HttpResponse::status怎么用?PHP HttpResponse::status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpResponse
的用法示例。
在下文中一共展示了HttpResponse::status方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionLongPoller
public function actionLongPoller()
{
$model = new LongPoller();
//$request = http_get_request_body();
$request = json_encode(array("deviceID" => "90:C1:15:BC:97:4F", "orderNo" => "1"));
$model->decodeStatusRequest($request);
$model->checkStatus();
$responseMsg = $model->generateResponse();
HttpResponse::status(200);
HttpResponse::setContentType('application/json');
HttpResponse::setData($responseMsg);
HttpResponse::send();
}
开发者ID:nsawant942,项目名称:Canteen-Management-Software-System--Witwatersrand,代码行数:13,代码来源:MobileController.php
示例2: json_encode
<?php
require_once 'HTTP/Request2/Response.php';
//echo "Hello there you are now connected to the canteen web server <br />";
/*HttpResponse::status(200);
HttpResponse::setContentType('json');
//HttpResponse::setHeader('From', 'Lymber');
HttpResponse::setData($_POST);
HttpResponse::send();*/
$connection = Yii::app()->db;
$sql_select = 'SELECT * FROM menu';
$command = $connection->createCommand($sql_select);
$menuData = $command->query();
$row = $menuData->readAll();
$json_string = json_encode(array("updated" => "false", 'menu:' => $row));
$headers = http_get_request_headers();
$result = http_get_request_body();
$decodeResult = json_decode($result);
HttpResponse::status(200);
HttpResponse::setContentType('application/json');
//HttpResponse::setHeader('From', 'Lymber');
HttpResponse::setData($json_string);
HttpResponse::send();
flush();