| Conditions | 5 |
| Paths | 3 |
| Total Lines | 23 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function actionIndex() |
||
| 25 | { |
||
| 26 | if (!$this->checkAccessToAdministrate()) { |
||
| 27 | return $this->accessError(); |
||
| 28 | } |
||
| 29 | |||
| 30 | /* @var $model \app\models\Setting */ |
||
| 31 | $model = Yii::$app->get('settings') |
||
| 32 | ->setModel() |
||
| 33 | ->getSettings(); |
||
| 34 | |||
| 35 | if (Yii::$app->request->isPost && $model->load(Yii::$app->request->post()) && $model->save()) { |
||
| 36 | return $this->redirect([ |
||
| 37 | '/'.$this->shortLanguage.'/admin/settings' |
||
| 38 | ]); |
||
| 39 | } |
||
| 40 | |||
| 41 | $fields = [ |
||
| 42 | 'model' => $model, |
||
| 43 | 'roles' => Yii::$app->authManager->getRoles() |
||
| 44 | ]; |
||
| 45 | |||
| 46 | return $this->render('index', $fields); |
||
| 47 | } |
||
| 49 |