Add System::jsonError method for ajax call returns

This commit is contained in:
Hypolite Petovan 2019-02-23 15:25:41 -05:00
parent ae7115894f
commit 7e499647e3

View file

@ -176,6 +176,12 @@ class System extends BaseObject
exit();
}
public static function jsonError($httpCode, $data, $content_type = 'application/json')
{
header($_SERVER["SERVER_PROTOCOL"] . ' ' . $httpCode);
self::jsonExit($data, $content_type);
}
/**
* @brief Encodes content to json.
*