Json에 PASS_THROUGH 옵션 추가

This commit is contained in:
Hide_D committed 2018-04-12 02:59:44 +09:00
1 parent 6220d030dc
commit 42cd2fafdd
2 files changed
+5 -1

No files matched your search

+1 -1
View File
@@ -39,4 +39,4 @@ if(!$map){
]);
}
Json::die(Json::decode($map));
Json::die($map, Json::PASS_THROUGH);
+4
View File
@@ -6,6 +6,7 @@ class Json
const PRETTY = 1;
const DELETE_NULL = 2;
const NO_CACHE = 4;
const PASS_THROUGH = 8;
public static function encode($value, $flag = 0)
{
@@ -33,6 +34,9 @@ class Json
header('Content-Type: application/json');
if($flag & static::PASS_THROUGH){
die($value);
}
die(Json::encode($value, $flag));
}
}