Conditions | 4 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function profileFieldUpdate($id = null) |
||
29 | { |
||
30 | // get current record or new and init form DI |
||
31 | $record = ProfileField::findOrNew($id); |
||
32 | $model = new FormFieldUpdate($record); |
||
33 | |||
34 | // check if form is submitted |
||
35 | if ($model->send() && $model->validate()) { |
||
36 | $model->save(); |
||
37 | if ($record->id) { |
||
38 | $this->response->redirect('profile/fieldlist'); |
||
39 | } |
||
40 | App::$Session->getFlashBag()->add('success', __('Profile field was successful updated')); |
||
41 | } |
||
42 | |||
43 | return $this->view->render('profile/field_update', [ |
||
44 | 'model' => $model |
||
45 | ]); |
||
47 | } |