@@ 104-114 (lines=11) @@ | ||
101 | * @param array $errors |
|
102 | * @return mixed Rendered output |
|
103 | */ |
|
104 | public function renderErrors($errors){ |
|
105 | ||
106 | $html = $this->render(Config::get('VIEWS_PATH') . 'alerts/errors.php', ["errors" => $errors]); |
|
107 | ||
108 | if($this->controller->request->isAjax()){ |
|
109 | return $this->renderJson(array("error" => $html)); |
|
110 | }else{ |
|
111 | $this->controller->response->setContent($html); |
|
112 | return $html; |
|
113 | } |
|
114 | } |
|
115 | ||
116 | /** |
|
117 | * Renders success message |
|
@@ 123-133 (lines=11) @@ | ||
120 | * @param string $message |
|
121 | * @return mixed Rendered output |
|
122 | */ |
|
123 | public function renderSuccess($message){ |
|
124 | ||
125 | $html = $this->render(Config::get('VIEWS_PATH') . 'alerts/success.php', array("success" => $message)); |
|
126 | ||
127 | if($this->controller->request->isAjax()){ |
|
128 | return $this->renderJson(array("success" => $html)); |
|
129 | }else{ |
|
130 | $this->controller->response->setContent($html); |
|
131 | return $html; |
|
132 | } |
|
133 | } |
|
134 | ||
135 | /** *********************************************** **/ |
|
136 | /** ************** JSON View ************** **/ |