Example #1
0
 /**
  * 输出返回数据
  * @access protected
  * @param mixed $data 要返回的数据
  * @param String $type 返回类型 JSON XML
  * @param integer $code HTTP状态
  * @return void
  */
 protected function response($data, $type = '', $code = 200)
 {
     Response::sendHttpStatus($code);
     Response::returnData($data, strtolower($type));
 }
Example #2
0
 /**
  * 输出返回数据
  * @access protected
  * @param mixed $data 要返回的数据
  * @param String $type 返回类型 JSON XML
  * @param integer $code HTTP状态
  * @return void
  */
 protected function response($data, $type = '', $code = 200)
 {
     Response::sendHttpStatus($code);
     Response::data($data);
     if ($type) {
         Response::type($type);
     }
 }
Example #3
0
File: rest.php Project: uubos/think
 /**
  * 输出返回数据
  * @access protected
  * @param mixed $data 要返回的数据
  * @param String $type 返回类型 JSON XML
  * @param integer $code HTTP状态
  * @return void
  */
 protected function response($data, $type = '', $code = 200)
 {
     Response::sendHttpStatus($code);
     return Response::returnData($data, $type, 1);
 }