| Conditions | 5 |
| Paths | 4 |
| Total Lines | 22 |
| Code Lines | 13 |
| Lines | 22 |
| Ratio | 100 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | View Code Duplication | public function actionSettings() |
|
| 22 | { |
||
| 23 | if (\Yii::$app->request->isPost) { |
||
| 24 | $model = new GoogleFeed(); |
||
| 25 | if ($model->load(Yii::$app->request->post()) && $model->validate()) { |
||
| 26 | $model->saveConfig(); |
||
| 27 | } elseif ($model->hasErrors()) { |
||
| 28 | Yii::$app->session->setFlash('error', Helper::formatModelErrors($model, '<br />')); |
||
| 29 | } |
||
| 30 | return $this->refresh(); |
||
| 31 | } |
||
| 32 | |||
| 33 | $model = new GoogleFeed(); |
||
| 34 | $model->loadConfig(); |
||
| 35 | |||
| 36 | return $this->render( |
||
| 37 | 'settings', |
||
| 38 | [ |
||
| 39 | 'model' => $model |
||
| 40 | ] |
||
| 41 | ); |
||
| 42 | } |
||
| 43 | |||
| 45 | } |