Conditions | 3 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | public function settings() |
||
27 | { |
||
28 | // initialize settings model |
||
29 | $model = new FormSettings($this->getConfigs()); |
||
|
|||
30 | |||
31 | // check if form is send |
||
32 | if ($model->send()) { |
||
33 | if ($model->validate()) { |
||
34 | $this->setConfigs($model->getAllProperties()); |
||
35 | App::$Session->getFlashBag()->add('success', __('Settings is successful updated')); |
||
36 | $this->response->redirect('comments/index'); |
||
37 | } else { |
||
38 | App::$Session->getFlashBag()->add('error', __('Form validation is failed')); |
||
39 | } |
||
40 | } |
||
41 | |||
42 | // render view |
||
43 | return $this->view->render('comments/settings', [ |
||
44 | 'model' => $model |
||
45 | ]); |
||
47 | } |