Passed
Pull Request — dev (#45)
by Stone
04:38 queued 02:16
created

Config::index()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 14
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Controllers\Admin;
4
5
use App\Models\ConfigModel;
6
use Core\AdminController;
7
8
/**
9
 * all to do with the config page
10
 * Class Config
11
 * @package App\Controllers\Admin
12
 */
13
class Config extends AdminController
14
{
15
    /**
16
     * Shows the config page with all of the config options
17
     * @throws \Twig_Error_Loader
18
     * @throws \Twig_Error_Runtime
19
     * @throws \Twig_Error_Syntax
20
     */
21
    public function index()
22
    {
23
        $this->onlyAdmin();
24
25
        //going to have to think of a better way of handeling this.
26
        $this->data['userRole'] = 'Admin';
27
        $this->data['userLevel'] = $this->auth->getUserLevel();
28
29
        $configObj = new ConfigModel($this->container);
30
        $this->data['configList'] = $configObj->getAllConfig();
31
32
33
34
        $this->renderView('Admin/Config');
35
    }
36
}
37