added renderJson
This commit is contained in:
parent
dba37e57f9
commit
24c8a3d9d7
|
@ -41,4 +41,14 @@ class Template
|
|||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* For AJAX calls, return json
|
||||
*/
|
||||
public function renderJson(array $results): never
|
||||
{
|
||||
http_response_code(response_code: $results['status']);
|
||||
echo json_encode(value: $results);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue