Version 0.9.5 beta - added additional json/application headers for a possible REST module

This commit is contained in:
Stephan Kasdorf
2020-10-01 00:06:10 +02:00
parent 47171d3fa6
commit 9e1ee98ff7
2 changed files with 19 additions and 7 deletions

View File

@@ -83,6 +83,15 @@ class View implements IView
exit();
}
/**
* @desc setting response to application json headers
*/
public static function forwardToJsonHeader()
{
header(self::NIBIRU_CONTENT_TYPE_JSON, true);
header(self::NIBIRU_CONTENT_TYPE_CONNECTION, true);
}
/**
* @param $page
*/

View File

@@ -10,11 +10,14 @@ namespace Nibiru;
*/
interface IView
{
const NIBIRU_SETTINGS = "SETTINGS";
const NIBIRU_URL = "pageurl";
const NIBIRU_ERROR = "ERROR";
const NIBIRU_SECURITY = "SECURITY";
const NIBIRU_ROUTING = "ROUTING";
const NIBIRU_EMAIL = "EMAIL";
const NIBIRU_FILE_END = ".tpl";
const NIBIRU_SETTINGS = "SETTINGS";
const NIBIRU_URL = "pageurl";
const NIBIRU_ERROR = "ERROR";
const NIBIRU_SECURITY = "SECURITY";
const NIBIRU_ROUTING = "ROUTING";
const NIBIRU_EMAIL = "EMAIL";
const NIBIRU_FILE_END = ".tpl";
const NIBIRU_CONTENT_TYPE_JSON = "Content-Type: application/json";
const NIBIRU_CONTENT_TYPE_CONNECTION = "Connection: keep-alive";
const NIBIRU_CONTENT_RESPONSE_OK = "HTTP/1.1 200 OK";
}