Completed
Push — master ( 970469...5d222c )
by Tobias
11:18
created

SiteController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 21
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A actionRootNode() 0 6 1
A actionIndex() 0 4 1
1
<?php
2
3
namespace app\controllers;
4
5
/*
6
 * @link http://www.diemeisterei.de/
7
 * @copyright Copyright (c) 2016 diemeisterei GmbH, Stuttgart
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
use dmstr\web\traits\AccessBehaviorTrait;
14
use yii\web\Controller;
15
16
/**
17
 * Site controller.
18
 */
19
class SiteController extends Controller
20
{
21
    use AccessBehaviorTrait;
22
23
    /**
24
     * Renders the start page.
25
     *
26
     * @return string
27
     */
28
    public function actionIndex()
29
    {
30
        return $this->render('index');
31
    }
32
33
    public function actionRootNode()
34
    {
35
        $rootNodeQuery = \dmstr\modules\pages\models\Tree::find()->where(['domain_id' => 'root']);
36
        $rootNode = $rootNodeQuery->one();
37
        return $this->run('/pages/default/page', ['pageId' => $rootNode->id]);
38
    }
39
}
40