Json에 PASS_THROUGH 옵션 추가
This commit is contained in:
+1
-1
@@ -39,4 +39,4 @@ if(!$map){
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Json::die(Json::decode($map));
|
Json::die($map, Json::PASS_THROUGH);
|
||||||
@@ -6,6 +6,7 @@ class Json
|
|||||||
const PRETTY = 1;
|
const PRETTY = 1;
|
||||||
const DELETE_NULL = 2;
|
const DELETE_NULL = 2;
|
||||||
const NO_CACHE = 4;
|
const NO_CACHE = 4;
|
||||||
|
const PASS_THROUGH = 8;
|
||||||
|
|
||||||
public static function encode($value, $flag = 0)
|
public static function encode($value, $flag = 0)
|
||||||
{
|
{
|
||||||
@@ -33,6 +34,9 @@ class Json
|
|||||||
|
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
|
|
||||||
|
if($flag & static::PASS_THROUGH){
|
||||||
|
die($value);
|
||||||
|
}
|
||||||
die(Json::encode($value, $flag));
|
die(Json::encode($value, $flag));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user