@@ 117-127 (lines=11) @@ | ||
114 | * @param array $errors |
|
115 | * @return mixed Rendered output |
|
116 | */ |
|
117 | public function renderErrors($errors){ |
|
118 | ||
119 | $html = $this->render(Config::get('VIEWS_PATH') . 'alerts/errors.php', ["errors" => $errors]); |
|
120 | ||
121 | if($this->controller->request->isAjax()){ |
|
122 | return $this->renderJson(array("error" => $html)); |
|
123 | }else{ |
|
124 | $this->controller->response->setContent($html); |
|
125 | return $html; |
|
126 | } |
|
127 | } |
|
128 | ||
129 | /** |
|
130 | * Renders success message |
|
@@ 136-146 (lines=11) @@ | ||
133 | * @param string $message |
|
134 | * @return mixed Rendered output |
|
135 | */ |
|
136 | public function renderSuccess($message){ |
|
137 | ||
138 | $html = $this->render(Config::get('VIEWS_PATH') . 'alerts/success.php', array("success" => $message)); |
|
139 | ||
140 | if($this->controller->request->isAjax()){ |
|
141 | return $this->renderJson(array("success" => $html)); |
|
142 | }else{ |
|
143 | $this->controller->response->setContent($html); |
|
144 | return $html; |
|
145 | } |
|
146 | } |
|
147 | ||
148 | /** *********************************************** **/ |
|
149 | /** ************** JSON View ************** **/ |