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

Config   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 14 1
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