1 <?php
2
3 /*
4 * To change this license header, choose License Headers in Project Properties.
5 * To change this template file, choose Tools | Templates
6 * and open the template in the editor.
7 */
8
9 namespace nk2580\wordsmith\Utillities;
10
11 /**
12 * Description of JsonException
13 *
14 * @author Nik Kyriakidis
15 */
16 class JsonResponse {
17
18 public static function showError($code = 100, $message = "an error occured") {
19 echo json_encode(['status' => 'error', 'code' => $code, 'message' => $message]);
20 exit;
21 }
22
23 public static function showResponse($message = "your request was completed") {
24 echo json_encode(['status' => 'success', 'message' => $message]);
25 exit;
26 }
27
28 }
29