Version 0.9.5 beta - added additional additional configuration to the view
This commit is contained in:
@@ -84,12 +84,18 @@ class View implements IView
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param string $encoding
|
||||||
* @desc setting response to application json headers
|
* @desc setting response to application json headers
|
||||||
*/
|
*/
|
||||||
public static function forwardToJsonHeader()
|
public static function forwardToJsonHeader( string $encoding = "" )
|
||||||
{
|
{
|
||||||
header(self::NIBIRU_CONTENT_TYPE_JSON, true);
|
header(self::NIBIRU_CONTENT_TYPE_JSON, true);
|
||||||
header(self::NIBIRU_CONTENT_TYPE_CONNECTION, true);
|
header(self::NIBIRU_CONTENT_TYPE_CONNECTION, true);
|
||||||
|
header(self::NIBIRU_CONTENT_ENCODING, true);
|
||||||
|
if(strlen($encoding)>0)
|
||||||
|
{
|
||||||
|
header(str_replace('{transfer}', $encoding, self::NIBIRU_CONTENT_TRANSFER_ENCODING));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ interface IView
|
|||||||
const NIBIRU_ROUTING = "ROUTING";
|
const NIBIRU_ROUTING = "ROUTING";
|
||||||
const NIBIRU_EMAIL = "EMAIL";
|
const NIBIRU_EMAIL = "EMAIL";
|
||||||
const NIBIRU_FILE_END = ".tpl";
|
const NIBIRU_FILE_END = ".tpl";
|
||||||
const NIBIRU_CONTENT_TYPE_JSON = "Content-Type: application/json";
|
const NIBIRU_CONTENT_TYPE_JSON = "Content-Type: application/json";
|
||||||
const NIBIRU_CONTENT_TYPE_CONNECTION = "Connection: keep-alive";
|
const NIBIRU_CONTENT_TYPE_CONNECTION = "Connection: keep-alive";
|
||||||
const NIBIRU_CONTENT_RESPONSE_OK = "HTTP/1.1 200 OK";
|
const NIBIRU_CONTENT_RESPONSE_OK = "HTTP/1.1 200 OK";
|
||||||
|
const NIBIRU_CONTENT_ENCODING = "Accept-Encoding: gzip, deflate";
|
||||||
|
const NIBIRU_CONTENT_TRANSFER_ENCODING = "Transfer-Encoding: {encoding}";
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user