Completed
Push — develop ( 2d4f17...d5975b )
by Nate
05:25
created

GeneralController::actionIndex()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 0
cts 12
cp 0
rs 9.7666
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://flipboxfactory.com/software/hubspot/license
6
 * @link       https://www.flipboxfactory.com/software/hubspot/
7
 */
8
9
namespace flipbox\craft\hubspot\cp\controllers\settings\view;
10
11
use flipbox\craft\hubspot\records\Connection;
12
use flipbox\craft\hubspot\web\assets\base\Base;
13
use yii\web\Response;
14
15
/**
16
 * @author Flipbox Factory <[email protected]>
17
 * @since 1.0.0
18
 */
19
class GeneralController extends AbstractController
20
{
21
    /**
22
     * The template base path
23
     */
24
    const TEMPLATE_BASE = parent::TEMPLATE_BASE . '/general';
25
26
    /**
27
     * The index view template path
28
     */
29
    const TEMPLATE_INDEX = self::TEMPLATE_BASE . '/index';
30
31
    /**
32
     * @return Response
33
     * @throws \yii\base\InvalidConfigException
34
     */
35
    public function actionIndex(): Response
36
    {
37
        $variables = [];
38
        $this->baseVariables($variables);
39
40
        $this->view->registerAssetBundle(Base::class);
41
42
        $variables['connections'] = Connection::find()->all();
43
        $variables['fullPageForm'] = true;
44
45
        return $this->renderTemplate(
46
            static::TEMPLATE_INDEX,
47
            $variables
48
        );
49
    }
50
51
    /*******************************************
52
     * BASE PATHS
53
     *******************************************/
54
55
    /**
56
     * @return string
57
     */
58
    protected function getBaseActionPath(): string
59
    {
60
        return parent::getBaseActionPath() . '/general';
61
    }
62
}
63