Passed
Pull Request — dev (#47)
by Stone
04:17 queued 01:57
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
     * @throws \ReflectionException
21
     */
22
    public function index()
23
    {
24
        $this->onlyAdmin();
25
26
        //going to have to think of a better way of handeling this.
27
        $this->data['userRole'] = 'Admin';
28
        $this->data['userLevel'] = $this->auth->getUserLevel();
29
30
        $configObj = new ConfigModel($this->container);
31
        $this->data['configList'] = $configObj->getAllConfigOrdered();
32
33
34
35
        $this->renderView('Admin/Config');
36
    }
37
}
38