Completed
Push — master ( e45dbf...3a73d5 )
by Nate
05:43 queued 04:08
created

SettingsController   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 3
dl 0
loc 60
ccs 0
cts 23
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A actionIndex() 0 9 1
A getBaseActionPath() 0 4 1
A getBaseCpPath() 0 4 1
A baseVariables() 0 9 1
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://flipboxfactory.com/software/patron/license
6
 * @link       https://www.flipboxfactory.com/software/patron/
7
 */
8
9
namespace flipbox\patron\cp\controllers\view;
10
11
use Craft;
12
use craft\helpers\UrlHelper;
13
14
/**
15
 * @author Flipbox Factory <[email protected]>
16
 * @since 1.0.0
17
 */
18
class SettingsController extends AbstractViewController
19
{
20
    /**
21
     * The index view template path
22
     */
23
    const TEMPLATE_INDEX = AbstractViewController::TEMPLATE_BASE . '/settings';
24
25
    /**
26
     * Index
27
     *
28
     * @return \yii\web\Response
29
     */
30
    public function actionIndex()
31
    {
32
        $variables = [];
33
        $this->baseVariables($variables);
34
35
        $variables['fullPageForm'] = true;
36
37
        return $this->renderTemplate(static::TEMPLATE_INDEX, $variables);
38
    }
39
40
41
    /*******************************************
42
     * BASE PATHS
43
     *******************************************/
44
45
    /**
46
     * @return string
47
     */
48
    protected function getBaseActionPath(): string
49
    {
50
        return parent::getBaseActionPath() . '/settings';
51
    }
52
53
    /**
54
     * @return string
55
     */
56
    protected function getBaseCpPath(): string
57
    {
58
        return parent::getBaseCpPath() . '/settings';
59
    }
60
61
    /*******************************************
62
     * VARIABLES
63
     *******************************************/
64
65
    /**
66
     * @inheritdoc
67
     */
68
    protected function baseVariables(array &$variables = [])
69
    {
70
        parent::baseVariables($variables);
71
72
        $variables['crumbs'][] = [
73
            'label' => Craft::t('patron', 'Settings'),
74
            'url' => UrlHelper::url($variables['baseCpPath'])
75
        ];
76
    }
77
}
78