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