<?php

function return_success($msg = 'OK') {
	return json_encode(['status' => 'success', 'message' => $msg]);
}

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 ]);
}

?>
