AdminController::actionIndex()   A
last analyzed

Complexity

Conditions 4
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.2
cc 4
eloc 5
nc 2
nop 0
1
<?php
2
3
namespace humhub\modules\privacybox\controllers;
4
5
use Yii;
6
use yii\helpers\Url;
7
use humhub\modules\admin\components\Controller;
8
9
class AdminController extends Controller
10
{
11
12
    /**
13
     * Configuration Action for Super Admins
14
     */
15
    public function actionIndex()
16
    {
17
        $form = new \humhub\modules\privacybox\models\forms\EditForm();
18
19
        if ($form->load(Yii::$app->request->post()) && $form->validate() && $form->save()) {
20
            return $this->redirect(Url::to(['/privacybox/admin/index']));
21
        }
22
23
        return $this->render('index', ['model' => $form]);
24
    }
25
26
}
27
28
?>
29