18 lines
373 B
PHP
18 lines
373 B
PHP
<?php
|
|
|
|
function return_success() {
|
|
return json_encode(['status' => 'success', 'message' => 'OK']);
|
|
}
|
|
|
|
function return_error($code, $msg) {
|
|
http_response_code($code);
|
|
return json_encode(['status' => 'error', 'message' => $msg]);
|
|
}
|
|
|
|
function twig_error($twig, $code, $msg) {
|
|
http_response_code($code);
|
|
return $twig->render('error.html.twig', [ 'error' => $msg ]);
|
|
}
|
|
|
|
?>
|