| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 51 | public function actionSettings(): ?string |
||
| 52 | { |
||
| 53 | // load model and pass property's as argument |
||
| 54 | $model = new FormUserSettings($this->getConfigs()); |
||
| 55 | |||
| 56 | if ($model->send()) { |
||
| 57 | if ($model->validate()) { |
||
| 58 | $this->setConfigs($model->getAllProperties()); |
||
| 59 | App::$Session->getFlashBag()->add('success', __('Settings is successful updated')); |
||
| 60 | $this->response->redirect('user/index'); |
||
| 61 | } else { |
||
| 62 | App::$Session->getFlashBag()->add('error', __('Form validation is failed')); |
||
| 63 | } |
||
| 64 | } |
||
| 65 | |||
| 66 | // render view |
||
| 67 | return $this->view->render('user/settings', [ |
||
| 68 | 'model' => $model |
||
| 69 | ]); |
||
| 72 |