diff --git a/core/c/view.php b/core/c/view.php index 404b8c1..ab86750 100755 --- a/core/c/view.php +++ b/core/c/view.php @@ -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 */ diff --git a/core/i/view.php b/core/i/view.php index 416324b..9727025 100644 --- a/core/i/view.php +++ b/core/i/view.php @@ -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"; } \ No newline at end of file