This repository has been archived on 2018-05-28. You can view files and clone it, but cannot push or open issues or pull requests.
BBB-Simple-ACS/server/src/View/Misc/Base.php

20 lines
443 B
PHP

<?php
namespace acs\View;
use Acast\Http\View;
use Workerman\Protocols\Http;
abstract class Base extends View
{
function retJson($msg, int $err = 0, ?int $http_code = null)
{
Http::header('Content-Type: application/json');
if (isset($http_code))
Http::header('HTTP', $http_code);
$this->_controller->retMsg = json_encode([
'err' => $err,
'data' => $msg
]);
}
}