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