Outputrest : manage the http_response_code() if set
This commit is contained in:
@@ -32,9 +32,10 @@ class Outputrest extends Output
|
||||
$layout = FALSE, $replacement = array(),
|
||||
$variable = array (), $module = "")
|
||||
{
|
||||
if (! isset ($variable["exceptionCode"]))
|
||||
$variable["exceptionCode"] = 200;
|
||||
$code = http_response_code();
|
||||
if (isset ($variable["exceptionCode"]))
|
||||
$code = $variable["exceptionCode"];
|
||||
$rest = new Rest ();
|
||||
$rest->display ($data, $variable["exceptionCode"]);
|
||||
$rest->display ($data, $code);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user