|
@@ -58,6 +58,9 @@ discard block |
|
|
block discarded – undo |
|
58
|
58
|
return $this->notFound($request, $response, $return_type, 'Controller ' . $route . '/' . $action . " not found"); |
|
59
|
59
|
} |
|
60
|
60
|
|
|
|
61
|
+ /** |
|
|
62
|
+ * @param string $function_name |
|
|
63
|
+ */ |
|
61
|
64
|
private function returnJson($function_name, $request, $args, $response){ |
|
62
|
65
|
$status = 500; |
|
63
|
66
|
$function_output = call_user_func($function_name, $request, $args); |
|
@@ -73,6 +76,11 @@ discard block |
|
|
block discarded – undo |
|
73
|
76
|
return $response->withHeader('Content-Type', 'application/json;charset=utf-8')->withHeader('X-Powered-By', "reformo/rslim")->withStatus($status); |
|
74
|
77
|
} |
|
75
|
78
|
|
|
|
79
|
+ /** |
|
|
80
|
+ * @param string $function_name |
|
|
81
|
+ * @param string $action |
|
|
82
|
+ * @param string $template |
|
|
83
|
+ */ |
|
76
|
84
|
private function returnHtml($function_name, $request, $args, $response, $route, $action, $template){ |
|
77
|
85
|
if (!file_exists($this->config['base_dir'] . $template)) { |
|
78
|
86
|
throw new \Exception("<strong>Template file not found!</strong> " . $route . '/' . $action . " needs a template file at:" . $template); |
Please login to merge, or discard this patch.